EventStore / EventStore-Client-Go

Go Client for Event Store version 20 and above.
Apache License 2.0
103 stars 25 forks source link

How to determine if stream is non-existing on subscription #147

Closed wiegell closed 1 year ago

wiegell commented 1 year ago

The documentation explains how to check if a stream exists when doing a read: https://developers.eventstore.com/clients/grpc/reading-events.html#checking-if-the-stream-exists

But the subscription.Recv() does not return an error - what happens if i try and subscribe to a non-existing stream? And how to handle it? Do i need to first check if the stream exists with a read?

YoEight commented 1 year ago

Hey @wiegell, subscribing to a non existing stream is not an error. Eventually, you'd receive something if an event is appended to that stream at some point.

wiegell commented 1 year ago

Ok thanks for the clarification