/// <summary> /// This method parses an event from a stream and queues it /// </summary> /// <param name="s"> This stream should contain one complete event with no delimiter </param> private void QueueNextMessageInStream(MemoryStream s) { s.Seek(messageStartLoc, SeekOrigin.Begin); Protocol.Event incomingEvent = Protocol.Event.Parser.ParseDelimitedFrom(s); EventQueue.QueueEvent(incomingEvent); State.LengthStream.SetLength(0); }
/// <summary> /// Setups the global event subscribers. /// </summary> private static void SetupGlobalEventSubscribers(IEventQueue queue) { Event.Subscribe("cachemanager:clear:remote", (object sender, EventArgs args) => queue.QueueEvent(new CacheClearRemoteEvent(Event.ExtractParameter <CacheClearRemoteEventArgs>(args, 0).CacheIds))); }