Reading Stream from Version N

I have no problem reading a full event stream, but when I try to read from version N, the connection will just hang until the timeout.

Master branch.

//event stream contains ~16000 events

var slice = await connection.ReadEventStreamForwardAsync(streamName, 1500, int.MaxValue);

Is this a know bug?

Thanks,

Chris

I haven’t confirmed with the codebase, but it seems that the server is trying to read up until int.MaxValue and that’s what’s taking so much time.

If I give it a start and reasonable count, it works great.

I ended up looping the reads in batches of X until I read zero, or less than the batch size, records. Works great.

Hi Chris!

Thanks for your feedback. It’s an overflow bug,

we will fix that and add a test for ClientApi to verify.

For now a one possible workaround is to read batches until you receive empty one.

Пʼятниця, 26 жовтня 2012 р. 05:37:43 UTC+3 користувач Chris Martin написав:

The client API could ideally do this on its own as well. Saying I want
to read 1.5m events is not a very useful operation from a client
perspective. Better would be to have it break this up for you and make
it transparent to you.

Pushed 8a06133be143d0fa1594f09d50a32d023ae59615 to dev branch

Пʼятниця, 26 жовтня 2012 р. 05:37:43 UTC+3 користувач Chris Martin написав:

Excellent!

Thanks everyone.