protected virtual void OnMessage( object sender, Message <string, TMessage> message) { MessagesQueue.Enqueue(message); SetLastReceivedMessagePerTopicPartition(message); if (MessagesQueue.Count >= ConsumerSettings.QueueBufferingMaxMessages) { ProcessQueue(); } }
public void EnQueueMessage(string to, string from, string message) { Messages msg = new Messages { FromEmailAddress = from, ToEmailAddress = to, Message = message }; MessagesQueue.Enqueue(msg); HasMessage = true; }
/// <summary> /// WndProc handler, pushes all messages to event queue /// <para>The downside of doing it this way is that LParam and WParam are not valid in case they are pointers when the method exits</para> /// </summary> /// <param name="m"></param> protected override void WndProc(ref Message m) { base.WndProc(ref m); if ((MessagesQueue == null) || (TransformMessage == null)) { return; } var tm = TransformMessage(ref m); if (tm != null) { MessagesQueue.Enqueue(tm); } }