public bool Inspect <TSaga, TMessage>(SagaWorkerMessageSink <TSaga, TMessage> sink) where TMessage : class where TSaga : SagaStateMachine <TSaga>, ISaga { Append(string.Format("Saga Distributor Worker ({0} - {1})", typeof(TSaga).Name, typeof(TMessage).Name)); return(true); }
public UnsubscribeAction Connect(IInboundPipelineConfigurator configurator, object instance) { var worker = instance as ISagaWorker <TSaga>; ISagaMessageSink <TSaga, TMessage> sink = _connector.CreateSink(); var workerSink = new SagaWorkerMessageSink <TSaga, TMessage>(worker, sink); return(configurator.Pipeline.ConnectToRouter(workerSink, () => configurator.SubscribedTo <Distributed <TMessage> >())); }
private UnsubscribeAction ConnectToSink <TSaga, TMessage>(ISubscriberContext context, ISagaWorker <TSaga> worker, DataEvent <TSaga, TMessage> eevent, IEnumerable <State> states) where TSaga : SagaStateMachine <TSaga>, ISaga where TMessage : class { var factory = new SagaStateMachineMessageSinkFactory <TSaga, TMessage>(context, _policyFactory); IPipelineSink <TMessage> sink = factory.Create(eevent, states); var workerSink = new SagaWorkerMessageSink <TSaga, TMessage>(worker, sink); return(context.Pipeline.ConnectToRouter(workerSink, () => context.SubscribedTo <Distributed <TMessage> >())); }