Exemplo n.º 1
0
 public void Deliver(IMessageHubMessage message)
 {
     if (_deliveryAction.IsAlive)
     {
         ((Action <TMessage>)_deliveryAction.Target).Invoke((TMessage)message);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Delivers the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="subscription">The subscription.</param>
        public void Deliver(IMessageHubMessage message, IMessageHubSubscription subscription)
        {
            if (subscription == null)
            {
                throw new ArgumentNullException(nameof(subscription));
            }

            subscription.Deliver(message);
        }
Exemplo n.º 3
0
            public void Deliver(IMessageHubMessage message)
            {
                if (!(message is TMessage))
                {
                    throw new ArgumentException("Message is not the correct type");
                }

                _deliveryAction.Invoke((TMessage)message);
            }
Exemplo n.º 4
0
            public bool ShouldAttemptDelivery(IMessageHubMessage message)
            {
                if (!(message is TMessage))
                {
                    return(false);
                }

                return(_messageFilter.Invoke((TMessage)message));
            }
Exemplo n.º 5
0
            public bool ShouldAttemptDelivery(IMessageHubMessage message)
            {
                if (!(message is TMessage) || !_deliveryAction.IsAlive || !_messageFilter.IsAlive)
                {
                    return(false);
                }

                return(((Func <TMessage, bool>)_messageFilter.Target).Invoke((TMessage)message));
            }
Exemplo n.º 6
0
            public void Deliver(IMessageHubMessage message)
            {
                if (!(message is TMessage))
                {
                    throw new ArgumentException("Message is not the correct type");
                }

                if (!_deliveryAction.IsAlive)
                {
                    return;
                }

                ((Action <TMessage>)_deliveryAction.Target).Invoke((TMessage)message);
            }
Exemplo n.º 7
0
 public void Deliver(IMessageHubMessage message) => _deliveryAction.Invoke((TMessage)message);
Exemplo n.º 8
0
 public bool ShouldAttemptDelivery(IMessageHubMessage message) => _messageFilter.Invoke((TMessage)message);
Exemplo n.º 9
0
 public bool ShouldAttemptDelivery(IMessageHubMessage message) =>
 _deliveryAction.IsAlive && _messageFilter.IsAlive &&
 ((Func <TMessage, bool>)_messageFilter.Target).Invoke((TMessage)message);
Exemplo n.º 10
0
 /// <summary>
 ///     Delivers the specified message.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="subscription">The subscription.</param>
 public void Deliver(IMessageHubMessage message, IMessageHubSubscription subscription)
 {
     subscription.Deliver(message);
 }
Exemplo n.º 11
0
 public bool ShouldAttemptDelivery(IMessageHubMessage message)
 {
     return(_messageFilter.Invoke((TMessage)message));
 }