/// <summary> /// Raised from the <see cref="ScheduleCommandContext.Execute"/> when scheduling provider deems. /// </summary> /// <param name="context">The context directly handler.</param> private void OnScheduledCommand(ScheduleCommandContext context) { // The null passed because we currently don't support contexts. DistributeExecution( context.Envelope.Body, null, context.Envelope, context.Envelope.Body as ICommand, context.Handler ); }
private bool TrySchedule(Envelope envelope, HandlerDescriptor handler, ArgumentDescriptor argument) { if (schedulingProvider.IsLaterExecutionRequired(envelope)) { ScheduleCommandContext context = new ScheduleCommandContext(handler, argument, envelope, OnScheduledCommand); schedulingProvider.Schedule(context); return(true); } return(false); }