These are chat archives for akkadotnet/AkkaStreams

17th
Sep 2017
Bartosz Sypytkowski
@Horusiath
Sep 17 2017 07:03
guys, I've got semi-philosophical question about order or events/errors. As we know that events and errors are traveling through stream in separate lanes, it looks like it's basically impossible to guarantee order between two - also due to fact that errors don't need to be subscription.Request(demand) i.e.:
publisher.Event(1);
publisher.Error(new Exception());
publisher.Event(2);

// version 1 - expect messages in order - error is notified anyway as it doesn't take demand into account
subscription.Request(2);

subscription.ExpectNext(1);
subscription.ExpectError();
subscription.ExpectNext(2);

// version 2 - expect errors to be out of order
subscription.Request(2);

subscription.ExpectError();
subscription.ExpectNext(1);
subscription.ExpectNext(2);

// version 3 - after an error no new events are allowed (tbh. this depends on the downstream behavior)
subscription.Request(2);

subscription.ExpectError();
I need to read reactive streams specs to determine the correct output , I hope it's defined there ;)