Beispiel #1
0
        /// <summary>
        /// Subscribes the specified handler to the spified message type. Message types
        /// can be conrecrete types or interfaces that act as groups spanning several
        /// messages types
        /// </summary>
        /// <typeparam name="TMessage">
        /// The type of message to subscribe to. Message types
        /// can be conrecrete types or interfaces that act as groups spanning several
        /// messages types
        /// </typeparam>
        /// <typeparam name="TMessageHandler">The handler to invoke when the message is published</typeparam>
        public IMessageSubscriptionConfig Subscribe <TMessage, TMessageHandler>()
            where TMessage : class
            where TMessageHandler : IMessageHandler <TMessage>
        {
            _messageAggregator.Subscribe <TMessage, TMessageHandler>();

            return(this);
        }
Beispiel #2
0
 public void Subscribe(object handler, Action <object, Exception> onError = null)
 {
     _aggregator.Subscribe(handler, onError);
 }
Beispiel #3
0
 /// <summary>
 /// Subscribes the specified handler to the spified message type. Message types
 /// can be conrecrete types or interfaces that act as groups spanning several
 /// messages types
 /// </summary>
 /// <typeparam name="TMessage">
 /// The type of message to subscribe to. Message types
 /// can be conrecrete types or interfaces that act as groups spanning several
 /// messages types
 /// </typeparam>
 /// <typeparam name="TMessageHandler">The handler to invoke when the message is published</typeparam>
 public void Subscribe <TMessage, TMessageHandler>()
     where TMessage : class
     where TMessageHandler : IMessageHandler <TMessage>
 {
     _messageAggregator.Subscribe <TMessage, TMessageHandler>();
 }