Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codec: Add/default to ReadOnlyMemory format instead of byte[] #75

Merged
merged 3 commits into from
May 5, 2022

Conversation

bartelink
Copy link
Collaborator

@bartelink bartelink commented May 5, 2022

In Equinox V4, stores now accept/provide events in two primary formats (previously everything was byte[]):

  • ReadOnlyMemory<byte>: Replaces byte[] as the default event body type, in order to facilitate pooling etc (EventStoreDB uses it directly, Equinox.DynamoStore maps internally to what the AWS SDK demands at present (MemoryStream))
  • JsonElement: Equinox.CosmosStore now natively uses System.Text.Json so event bodies can be emitted cleanly and directly using that format

The key change is that SystemTextJson now has two static type roots;

  • CodecJsonElement, which is for use with Equinox.CosmosStore V4 and later
  • Codec (which previously produced a JsonElement codec) that needed to be adapted for use with Equinox.CosmosStore is now equivalent in signature to Newtonsoft.Codec, and works directly with all other stores

@bartelink bartelink changed the base branch from master to v3 May 5, 2022 14:10
Base automatically changed from v3 to master May 5, 2022 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant