public void Publish(byte[] message, IEnumerable <MessageHeader> headers) { var offset = new InMemoryOffset(Name, NextOffset); _consumers.ForEach(c => c.Receive(message, headers, offset)); NextOffset++; }
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); }
public int CompareTo(InMemoryOffset other) { if (ReferenceEquals(this, other)) { return(0); } if (other is null) { return(1); } return(Offset.CompareTo(other.Offset)); }