Пример #1
0
        /// <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}");
        }
Пример #2
0
 /// <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");
 }
Пример #3
0
 /// <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");
 }
Пример #4
0
        public AsyncTaskProvider(TTask asyncTask)
        {
            asyncTask.NotNull(nameof(asyncTask));

            _asyncTask = asyncTask;
        }