mtesseract / nakadi-client

Haskell Client Library for the Nakadi Event Broker
Other
13 stars 9 forks source link

Exposed the constructor for the subscription stream context #44

Closed amrhassan closed 6 years ago

amrhassan commented 6 years ago

@etorreborre @mtesseract Let's discuss

etorreborre commented 6 years ago

@mtesseract I don't think we just need to expose the StreamId we already get it with SubscriptionEventStream when we start the subscription.

What I need is to create a SubscriptionEventStreamContext with the StreamId, SubscriptionId and the Config, all of which I already have, to be able to run the ReaderT SubscriptionEventStreamContext.

mtesseract commented 6 years ago

Hi,

Ok. I understand that having this constructor exported is useful to you right now. Therefore, let's merge it. At some point we should probably reconsider how to design the subscription streaming API in a way that is easier to adopt for non-conduit streaming. Maybe we can export a matching high-level API for other streaming packages side by side.

Background: My goal was to design the subscriptionSource/runSubscription/subscriptionSink API in such a way that the context can be completely opaque, it basically hides the work (streamId bookkeeping) necessary for commiting cursors.

Thanks!