Пример #1
0
        public void Publish(byte[] message, IEnumerable <MessageHeader> headers)
        {
            var offset = new InMemoryOffset(Name, NextOffset);

            _consumers.ForEach(c => c.Receive(message, headers, offset));

            NextOffset++;
        }
Пример #2
0
        public async Task <IOffset> PublishAsync(byte[] message, IEnumerable <MessageHeader> headers)
        {
            var offset = new InMemoryOffset(Name, NextOffset);
            await _consumers.ForEachAsync(c => c.Receive(message, headers, offset));

            NextOffset++;

            return(offset);
        }
Пример #3
0
 public int CompareTo(InMemoryOffset other)
 {
     if (ReferenceEquals(this, other))
     {
         return(0);
     }
     if (other is null)
     {
         return(1);
     }
     return(Offset.CompareTo(other.Offset));
 }