Exemplo n.º 1
0
 public static EventActivityBinder <TInstance> Schedule <TInstance, TMessage>(this EventActivityBinder <TInstance> source,
                                                                              Schedule <TInstance, TMessage> schedule, EventMessageFactory <TInstance, TMessage> messageFactory, Action <SendContext> contextCallback,
                                                                              ScheduleDelayProvider <TInstance> delayProvider)
     where TInstance : class, SagaStateMachineInstance
     where TMessage : class
 {
     return(source.Add(new ScheduleActivity <TInstance, TMessage>(messageFactory, schedule, contextCallback, delayProvider)));
 }
Exemplo n.º 2
0
        public FaultedScheduleActivity(EventExceptionMessageFactory <TInstance, TData, TException, TMessage> messageFactory,
                                       Schedule <TInstance, TMessage> schedule, ScheduleDelayProvider <TInstance, TData, TException> delayProvider)
        {
            _messageFactory = messageFactory;
            _schedule       = schedule;
            _delayProvider  = delayProvider;

            _sendPipe = Pipe.Empty <SendContext>();
        }
Exemplo n.º 3
0
        public ScheduleActivity(EventMessageFactory <TInstance, TMessage> messageFactory, Schedule <TInstance> schedule, Action <SendContext> contextCallback,
                                ScheduleDelayProvider <TInstance> delayProvider)
        {
            _messageFactory = messageFactory;
            _schedule       = schedule;
            _delayProvider  = delayProvider;

            _sendPipe = Pipe.Execute(contextCallback);
        }
Exemplo n.º 4
0
        public ScheduleActivity(EventMessageFactory <TInstance, TMessage> messageFactory, Schedule <TInstance> schedule,
                                ScheduleDelayProvider <TInstance> delayProvider)
        {
            _messageFactory = messageFactory;
            _schedule       = schedule;
            _delayProvider  = delayProvider;

            _sendPipe = Pipe.Empty <SendContext>();
        }
Exemplo n.º 5
0
 public static EventActivityBinder <TInstance, TData> Schedule <TInstance, TData, TMessage>(
     this EventActivityBinder <TInstance, TData> source, Schedule <TInstance, TMessage> schedule, TMessage message,
     ScheduleDelayProvider <TInstance, TData> delayProvider)
     where TInstance : class, SagaStateMachineInstance
     where TData : class
     where TMessage : class
 {
     return(source.Add(new ScheduleActivity <TInstance, TData, TMessage>(x => message, schedule, delayProvider)));
 }
Exemplo n.º 6
0
 public static ExceptionActivityBinder <TInstance, TData, TException> Schedule <TInstance, TData, TException, TMessage>(
     this ExceptionActivityBinder <TInstance, TData, TException> source, Schedule <TInstance, TMessage> schedule, TMessage message,
     Action <SendContext> contextCallback, ScheduleDelayProvider <TInstance, TData, TException> delayProvider)
     where TInstance : class, SagaStateMachineInstance
     where TData : class
     where TException : Exception
     where TMessage : class
 {
     return(source.Add(new FaultedScheduleActivity <TInstance, TData, TException, TMessage>(x => message, schedule, contextCallback, delayProvider)));
 }
        public static EventActivityBinder <TInstance> Schedule <TInstance, TMessage>(this EventActivityBinder <TInstance> source,
                                                                                     Schedule <TInstance, TMessage> schedule, AsyncEventMessageFactory <TInstance, TMessage> messageFactory,
                                                                                     ScheduleDelayProvider <TInstance> delayProvider, Action <SendContext <TMessage> > contextCallback = null)
            where TInstance : class, SagaStateMachineInstance
            where TMessage : class
        {
            DateTime TimeProvider(ConsumeEventContext <TInstance> context)
            {
                return(DateTime.UtcNow + delayProvider(context));
            }

            return(source.Add(new ScheduleActivity <TInstance, TMessage>(messageFactory, schedule, TimeProvider, contextCallback)));
        }