/// <summary> /// Calls a Task asynchronously. /// </summary> /// <param name="task">The Task to perform.</param> /// <param name="enterPhrase">The phrase to print before calling.</param> /// <param name="exitPhrase">The phrase to print after calling.</param> public async Task CallTaskAsync(ITaskAsync task, string enterPhrase, string exitPhrase) { Logger.Info($"{this} {enterPhrase} {task}"); await task.PerformAsAsync(this); Logger.Info($"{this} {exitPhrase} {task}"); }
/// <summary> /// Performs a Task asynchronously. /// The Actor must have the Abilities needed by the Task. /// </summary> /// <param name="task">The Task to perform.</param> public async Task CallsAsync(ITaskAsync task) { await CallTaskAsync(task, "calls", "successfully called"); }
/// <summary> /// Performs a Task asynchronously. /// The Actor must have the Abilities needed by the Task. /// </summary> /// <param name="task">The Task to perform.</param> public async Task AttemptsToAsync(ITaskAsync task) { await CallTaskAsync(task, "attempts to", "successfully did"); }
public AsyncTaskProvider(TTask asyncTask) { asyncTask.NotNull(nameof(asyncTask)); _asyncTask = asyncTask; }