Esempio n. 1
0
 public MessagingHubListener(IMessagingHubConnection connection, IMessagingHubSender sender = null, bool autoNotify = true)
 {
     _connection     = connection;
     _sender         = sender ?? new MessagingHubSender(connection);
     EnvelopeManager = new EnvelopeReceiverManager(this);
     _autoNotify     = autoNotify;
 }
 protected EnvelopeReceivedHandler(
     IMessagingHubSender sender,
     EnvelopeReceiverManager registrar,
     CancellationTokenSource cts)
 {
     Sender               = sender;
     _registrar           = registrar;
     _cts                 = cts;
     _envelopeActionBlock = new ActionBlock <TEnvelope>(async envelope =>
     {
         try
         {
             await CallReceiversAsync(envelope, _cts.Token);
         }
         catch (Exception ex)
         {
             //TODO: Create a ILogger interface to notify about errors on EnvelopeProcessor.
             Trace.TraceError(ex.ToString());
         }
     },
                                                        new ExecutionDataflowBlockOptions
     {
         MaxDegreeOfParallelism = DataflowBlockOptions.Unbounded,
         BoundedCapacity        = DataflowBlockOptions.Unbounded
     });
 }
 public NotificationReceivedHandler(IMessagingHubSender sender, EnvelopeReceiverManager registrar, CancellationTokenSource cts)
     : base(sender, registrar, cts)
 {
 }
Esempio n. 4
0
 public MessageReceivedHandler(IMessagingHubSender sender, bool autoNotifiy, EnvelopeReceiverManager registrar, CancellationTokenSource cts)
     : base(sender, registrar, cts)
 {
     _autoNotifiy = autoNotifiy;
 }
 public CommandReceivedHandler(IMessagingHubSender sender, EnvelopeReceiverManager envelopeManager, CancellationTokenSource cts)
     : base(sender, envelopeManager, cts)
 {
 }