mtesseract / nakadi-client

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

Provide a function to expose a Subscription as a Source #110

Closed etorreborre closed 6 years ago

etorreborre commented 6 years ago

With a signature similar to

subscriptionSourceEvents
  :: (MonadNakadi b m, MonadUnliftIO m, MonadMask m, FromJSON a)
  => SubscriptionId       -- ^ Subscription to consume
  -> ConduitM () a m () -- ^ Source of events
mtesseract commented 6 years ago

I have worked on this in the branch event-source.

You should now be able to do something like:

withTemporarySubscription ... $ \ subscription -> do
  runConduit $ subscriptionSourceEvents (subscription ^. L.id) .| ...

No support for the streaming package yet though.