jet / equinox

.NET event sourcing library with CosmosDB, DynamoDB, EventStoreDB, message-db, SqlStreamStore and integration test backends. Focused at stream level; see https://github.com/jet/propulsion for cross-stream projections/subscriptions/reactions
https://github.com/jet/dotnet-templates
Apache License 2.0
472 stars 68 forks source link

feat(Batcher): Add Limiter option #427

Closed bartelink closed 1 year ago

bartelink commented 1 year ago

Adds a facility to the Batcher that (optionally) extends the Linger period to include a phase during which a SemaphoreSlim is acquired:

bartelink commented 1 year ago

It definitely feels like a cleaner impl should be possible, and I'm also surprised I have not ran into anything similar. Being able to leave it open while there's batches in flight is definitely a big upgrade on trying 5/10/50/100 and convincing oneself that such a linger time makes sense overall in the context of some anticipated load