Write related methods currently accept two ByteChunk structs. This has been caused by the fact that Envelope is passed as a separate ref to the message chunk. This implies signatures for following:
public delegate bool WriteDelegate(int messageTypeId, ByteChunk chunk, ByteChunk chunk2) for IMessageWriter
and probably more. All this methods can be aligned to the new API using only a single ByteChunk. This may involve loss in a potential additional copy of bytes. To prevent this a Fody plugin can be provided, that will rewrite all the message structs adding one field of Envelope type. This field should be used to pass the message envelope and later on to read it. As the structure is passed by ref no overhead will be involved.
This task involves
[x] Write Fody plugin to add the Envelope field to all the messages (includes filtering messages types, could be via a custom attribute)
[x] Rewrite API + implementations of Readers/Writers.
Write related methods currently accept two
ByteChunk
structs. This has been caused by the fact thatEnvelope
is passed as a separateref
to the message chunk. This implies signatures for following:IRingBuffer.Write(int messageTypeId, ByteChunk chunk, ByteChunk chunk2 = default (ByteChunk))
public delegate bool WriteDelegate(int messageTypeId, ByteChunk chunk, ByteChunk chunk2)
forIMessageWriter
and probably more. All this methods can be aligned to the new API using only a singleByteChunk
. This may involve loss in a potential additional copy of bytes. To prevent this a Fody plugin can be provided, that will rewrite all the message structs adding one field ofEnvelope
type. This field should be used to pass the message envelope and later on to read it. As the structure is passed byref
no overhead will be involved.This task involves
Envelope
field to all the messages (includes filtering messages types, could be via a custom attribute)