/// <summary>
        /// Invokes the sent message.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="size">The size.</param>
        protected void InvokeSentMessage(string type, int size)
        {
            MessageGatewayEventHandler handler = SentMessage;

            if (handler != null)
            {
                Task.Factory.StartNew(() => handler(this, new MessageGatewayEventHandlerArgs
                {
                    MessageType = type,
                    Size        = size
                }));
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Invokes the sent message.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="size">The size.</param>
        protected void InvokeSentMessage(string type, int size)
        {
            MessageGatewayEventHandler handler = SentMessage;

            if (handler != null)
            {
                handler(this, new MessageGatewayEventHandlerArgs
                {
                    MessageType = type,
                    Size        = size
                });
            }
        }
        /// <summary>
        /// Invokes the received message.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="size">The size.</param>
        /// <param name="createdAt">The created at.</param>
        protected void InvokeReceivedMessage(string type, int size, DateTime createdAt)
        {
            MessageGatewayEventHandler handler = OnMessageBusReceived;

            if (handler != null)
            {
                Task.Factory.StartNew(() => handler(this, new MessageGatewayEventHandlerArgs
                {
                    CreatedAt   = createdAt,
                    MessageType = type,
                    Size        = size
                }));
            }
        }