runOnStrategyDispatcher
fun <T> AIAgentConfig.runOnStrategyDispatcher(executorService: ERROR CLASS: Symbol not found for ExecutorService?? = null, block: suspend () -> T): T(source)
Executes a given suspending block of code within a coroutine context on a strategy dispatcher that is determined by the provided executorService . If no executorService is supplied, it defaults to the AIAgentConfig.strategyExecutorService or falls back to Dispatchers.Default if none is configured.
Return
The result returned by the suspending block after execution.
Parameters
T
The return type of the suspending block.
executorService
The optional ExecutorService that determines the coroutine context. If null, the strategyExecutorService or Dispatchers.Default will be used as the fallback.
block
The suspending lambda to be executed in the resolved context.