.net grpc client while loop

Hello

I am starting to migrate to use the grpc client. I would like to know how to fetch event in chunks of 200.

The http client allowed to do a while loop and fetch events in chunks of 200.

How can I do that with the grpc client

Which language client are you migrating to?

I am using .net core 5

Is there a specific reason for the chunks? the gRPC client returns IAsyncEnumerable so you can read without the need for paging now

Oh. That’s nice to know. Suppose my aggregate has a few thousand event… That can be fetche without paging?

Yep, no need for the paging

Yep! Here is a sample implementation using the unit of work pattern: https://github.com/thefringeninja/Transacto/blob/master/src/Transacto.AspNetCore/Infrastructure/EventStoreRepository.cs

Thanks. That’s awesome. On another when will cloud version be ready for Azure?

@mat-mcloughlin another question. With the previous http client I had snapshotting. Backend I was snapshotting every 200 events. What is the best number to snapshot with GRPC, every 1k or 5k or 10k events?

That really depends on a number of things. How large are the events, how quick do you need to re-hydrate etc?

My suggestion would be to do some benchmarking around it