Esempio n. 1
0
 public UntypedFilterChannel(UntypedChannel output, SelectiveConsumer <TOutput> filter)
 {
     _output = output;
     _filter = filter;
 }
 /// <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;
 }
Esempio 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));
 }
Esempio 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));
 }
Esempio n. 6
0
 public PendingReceiveImpl(Inbox inbox, SelectiveConsumer <TMessage> selectiveConsumer,
                           Action <PendingReceiveImpl <TMessage> > onComplete)
     : this(inbox, selectiveConsumer, NoTimeoutCallback, onComplete)
 {
 }
Esempio n. 7
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer)
 {
     return(_inbox.Receive(consumer));
 }
Esempio n. 8
0
 public static RemoveActivation SelectiveReceive <T>(this RoutingEngineConfigurator configurator,
                                                     SelectiveConsumer <T> consumer)
 {
     return(_consumerFactory.Create(consumer, configurator));
 }
Esempio n. 9
0
 public SelectiveConsumerConfigurator(SelectiveConsumer <TChannel> consumer)
 {
     _consumer = consumer;
 }
Esempio n. 10
0
 public PendingReceiveImpl(SelectiveConsumer <T> selectiveConsumer, Action <PendingReceiveImpl <T> > onComplete)
     : this(selectiveConsumer, NoTimeoutCallback, onComplete)
 {
 }
Esempio n. 11
0
 public SelectiveConsumerNode(RoutingEngine engine, SelectiveConsumer <T> selectiveConsumer,
                              bool disableOnActivation = true)
     : base(engine, disableOnActivation)
 {
     _selectiveConsumer = selectiveConsumer;
 }
Esempio n. 12
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer, int timeout, Action timeoutCallback)
 {
     return(GetInbox <T>().Receive(consumer, timeout, timeoutCallback));
 }
Esempio n. 13
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer)
 {
     return(GetInbox <T>().Receive(consumer));
 }
Esempio n. 14
0
 public PendingReceive Receive <T>(SelectiveConsumer <T> consumer)
 {
     return(_inbox.Receive(CreateFilteredConsumer(consumer)));
 }