public Coroutine.Coroutine(Func<Task<object>> taskProducer)
Creates a new Coroutine instance using the supplied arguments.
taskProducerFunc<Task<object>>- Specifies task producer.
This class is used by IBots to create the loop of actions to make the bot work. Pls look at the NullBot exemple to see the exact implementation. This is a complex class that implement the async Task logic of the bot, you shouldent bother to much with it, just implement it like in NullBot and then execute the real bot logic in TaskManager.
Namespace: DreamPoeBot.Loki.Coroutine
public class CoroutineView DPB1 version →public Coroutine.Coroutine(Func<Task<object>> taskProducer)
Creates a new Coroutine instance using the supplied arguments.
taskProducerFunc<Task<object>>public Coroutine.Coroutine(Func<Task> taskProducer)
Creates a new Coroutine instance using the supplied arguments.
taskProducerFunc<Task>public void Coroutine.Dispose()
Releases resources owned by this instance.
public static Task Coroutine.ExternalTask(Func<Task> taskProducer)
Executes the external task operation with the supplied arguments.
taskProducerFunc<Task>Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task Coroutine.ExternalTask(Task externalTask)
Executes the external task operation with the supplied arguments.
externalTaskTaskReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<bool> Coroutine.ExternalTask(Task externalTask, int millisecondsTimeout)
Executes the external task operation with the supplied arguments.
externalTaskTaskmillisecondsTimeoutintReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<bool> Coroutine.ExternalTask(Task externalTask, TimeSpan timeout)
Executes the external task operation with the supplied arguments.
externalTaskTasktimeoutTimeSpanReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<T> Coroutine.ExternalTask<T>(Func<Task<T>> taskProducer)
Executes the external task operation with the supplied arguments.
taskProducerFunc<Task<T>>Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<T> Coroutine.ExternalTask<T>(Task<T> externalTask)
Executes the external task operation with the supplied arguments.
externalTaskTask<T>Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<ExternalTaskWaitResult<T>> Coroutine.ExternalTask<T>(Task<T> externalTask, int millisecondsTimeout)
Executes the external task operation with the supplied arguments.
externalTaskTask<T>millisecondsTimeoutintReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<ExternalTaskWaitResult<T>> Coroutine.ExternalTask<T>(Task<T> externalTask, TimeSpan timeout)
Executes the external task operation with the supplied arguments.
externalTaskTask<T>timeoutTimeSpanReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public void Coroutine.Resume()
Executes the resume operation.
public static Task Coroutine.Sleep(int milliseconds)
Executes the sleep operation with the supplied arguments.
millisecondsintReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task Coroutine.Sleep(TimeSpan timeout)
Executes the sleep operation with the supplied arguments.
timeoutTimeSpanReturns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public override string Coroutine.ToString()
Returns a text representation of this value.
Returns: The string result.
public static Task<bool> Coroutine.Wait(int maxWaitMs, Func<bool> condition)
Executes the wait operation with the supplied arguments.
maxWaitMsintconditionFunc<bool>Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task<bool> Coroutine.Wait(TimeSpan maxWaitTimeout, Func<bool> condition)
Executes the wait operation with the supplied arguments.
maxWaitTimeoutTimeSpanconditionFunc<bool>Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Task Coroutine.Yield()
Executes the yield operation.
Returns: An asynchronous operation. Await it before reading the result or continuing the workflow.
public static Coroutine Coroutine.Current { get; }
Gets current for Coroutine.
public CoroutineException Coroutine.FaultingException { get; private set; }
Gets faulting exception for Coroutine.
public bool Coroutine.IsDisposed { get; private set; }
Whether this coroutine is disposed.
public bool Coroutine.IsFinished { get; }
Whether this coroutine is finished.
public object Coroutine.Result { get; private set; }
Gets result for Coroutine.
public CoroutineStatus Coroutine.Status { get; private set; }
Gets status for Coroutine.
public int Coroutine.Ticks { get; private set; }
Gets ticks for Coroutine.
DPB2 0.4.5.88 · Reference reviewed 2026-10-02. Descriptions use source summaries where available, otherwise concise signature-based descriptions. Examples illustrate usage; they are not a live-game test.