/// <summary> /// Raised from the <see cref="ScheduleEventContext.Execute"/> when scheduling provider deems. /// </summary> /// <param name="context">The context publish.</param> private void OnScheduledEvent(ScheduleEventContext context) { DistributeExecution( context.Envelope.Body, context.HandlerContext, context.Envelope, context.Envelope.Body as IEvent, context.Handlers ).Wait(); }
private bool TrySchedule(Envelope envelope, object handlerContext, IEnumerable <HandlerDescriptor> handlers, ArgumentDescriptor argument) { if (schedulingProvider.IsLaterExecutionRequired(envelope)) { ScheduleEventContext context = new ScheduleEventContext(handlers, argument, envelope, handlerContext, OnScheduledEvent); schedulingProvider.Schedule(context); return(true); } return(false); }