Exemplo n.º 1
0
 public UntypedFilterChannel(UntypedChannel output, SelectiveConsumer <TOutput> filter)
 {
     _output = output;
     _filter = filter;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructs a channel
 /// </summary>
 /// <param name="fiber">The queue where consumer actions should be enqueued</param>
 /// <param name="selectiveConsumer">The method to call when a message is sent to the channel</param>
 public SelectiveConsumerChannel(Fiber fiber, SelectiveConsumer <T> selectiveConsumer)
 {
     _fiber             = fiber;
     _selectiveConsumer = selectiveConsumer;
 }
Exemplo n.º 3
0
 /// <summary>
 ///   Calls the specified method when a message of the requested type is received. The
 ///   consumer is asked if the message should be parsed, and returns a non-null action
 ///   if the message should be passed to the consumer. At that point, the message is removed
 ///   from the mailbox and delivered to the consumer
 /// </summary>
 /// <typeparam name = "T">The requested message type</typeparam>
 /// <param name="inbox">The inbox to receive the message from</param>
 /// <param name = "consumer">The consumer</param>
 /// <param name = "timeout">The time period to wait for a message</param>
 /// <param name = "timeoutCallback">The method to call if a message is not received within the timeout period</param>
 public static PendingReceive Receive <T>(this Inbox inbox, SelectiveConsumer <T> consumer, int timeout,
                                          Action timeoutCallback)
 {
     return(inbox.Receive(consumer, timeout.Milliseconds(), timeoutCallback));
 }
Exemplo n.º 4
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer, TimeSpan timeout, Action timeoutCallback)
 {
     return(_inbox.Receive(consumer, timeout, timeoutCallback));
 }
 public RemoveActivation SelectiveReceive <T>(SelectiveConsumer <T> consumer)
 {
     return(_consumerFactory.Create(consumer, this));
 }
Exemplo n.º 6
0
 public PendingReceiveImpl(Inbox inbox, SelectiveConsumer <TMessage> selectiveConsumer,
                           Action <PendingReceiveImpl <TMessage> > onComplete)
     : this(inbox, selectiveConsumer, NoTimeoutCallback, onComplete)
 {
 }
Exemplo n.º 7
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer)
 {
     return(_inbox.Receive(consumer));
 }
Exemplo n.º 8
0
 public static RemoveActivation SelectiveReceive <T>(this RoutingEngineConfigurator configurator,
                                                     SelectiveConsumer <T> consumer)
 {
     return(_consumerFactory.Create(consumer, configurator));
 }
Exemplo n.º 9
0
 public SelectiveConsumerConfigurator(SelectiveConsumer <TChannel> consumer)
 {
     _consumer = consumer;
 }
Exemplo n.º 10
0
 public PendingReceiveImpl(SelectiveConsumer <T> selectiveConsumer, Action <PendingReceiveImpl <T> > onComplete)
     : this(selectiveConsumer, NoTimeoutCallback, onComplete)
 {
 }
Exemplo n.º 11
0
 public SelectiveConsumerNode(RoutingEngine engine, SelectiveConsumer <T> selectiveConsumer,
                              bool disableOnActivation = true)
     : base(engine, disableOnActivation)
 {
     _selectiveConsumer = selectiveConsumer;
 }
Exemplo n.º 12
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer, int timeout, Action timeoutCallback)
 {
     return(GetInbox <T>().Receive(consumer, timeout, timeoutCallback));
 }
Exemplo n.º 13
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer)
 {
     return(GetInbox <T>().Receive(consumer));
 }
Exemplo n.º 14
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer)
 {
     return(_inbox.Receive(CreateFilteredConsumer(consumer)));
 }