Exemple #1
0
        public bool Enqueue(EventArgsLiveStreamMessage message)
        {
            Queue.Enqueue(message, message.Created);

            SignalNewMessage();

            return(true);
        }
        public void OnReceived(object sender, BasicDeliverEventArgs e)
        {
            LiveStreamMessage message = Newtonsoft.Json.JsonConvert.DeserializeObject <LiveStreamMessage>(
                Encoding.UTF8.GetString(e.Body),
                _configuration.SerializerSettings
                );

            var bufferMessage = new EventArgsLiveStreamMessage()
            {
                Created  = message.Timestamp,
                Received = DateTime.Now,
                Message  = message,
                Model    = _model,
                Tag      = e.DeliveryTag
            };

            Received?.Invoke(this, bufferMessage);
        }