public void Deliver(IMessageHubMessage message) { if (_deliveryAction.IsAlive) { ((Action <TMessage>)_deliveryAction.Target).Invoke((TMessage)message); } }
/// <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); }
public void Deliver(IMessageHubMessage message) { if (!(message is TMessage)) { throw new ArgumentException("Message is not the correct type"); } _deliveryAction.Invoke((TMessage)message); }
public bool ShouldAttemptDelivery(IMessageHubMessage message) { if (!(message is TMessage)) { return(false); } return(_messageFilter.Invoke((TMessage)message)); }
public bool ShouldAttemptDelivery(IMessageHubMessage message) { if (!(message is TMessage) || !_deliveryAction.IsAlive || !_messageFilter.IsAlive) { return(false); } return(((Func <TMessage, bool>)_messageFilter.Target).Invoke((TMessage)message)); }
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); }
public void Deliver(IMessageHubMessage message) => _deliveryAction.Invoke((TMessage)message);
public bool ShouldAttemptDelivery(IMessageHubMessage message) => _messageFilter.Invoke((TMessage)message);
public bool ShouldAttemptDelivery(IMessageHubMessage message) => _deliveryAction.IsAlive && _messageFilter.IsAlive && ((Func <TMessage, bool>)_messageFilter.Target).Invoke((TMessage)message);
/// <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); }
public bool ShouldAttemptDelivery(IMessageHubMessage message) { return(_messageFilter.Invoke((TMessage)message)); }