You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider a stream created of a Lwt_stream.from or Lwt_stream.from_direct. How are exceptions raised by the function creating stream's elements handled? How can the stream consumer arrange to be noticed about them?
I guess or would expect that the exception is conveyed by a failed thread returned by Lwt_stream.get, but the API-documentation does not go into these details.
Consider a stream created with Let_stream.create() how can the producer notify an error to the stream consumer? It seems that there is no provision for this and the creator and consumer must use a separate line to communicate the error – which is not very convenient!
Thanks!
The text was updated successfully, but these errors were encountered:
foretspaisibles
changed the title
How to propagate in Lwt streams?
How to propagate errors with Lwt streams?
May 26, 2015
I guess or would expect that the exception is conveyed by a failed thread returned by Lwt_stream.get, but the API-documentation does not go into these details.
This is correct, though a subsequent get can cause a subsequent call to the function f passed to from/from_direct, and that call to f might not fail.
Consider a stream created with Let_stream.create() how can the producer notify an error to the stream consumer? It seems that there is no provision for this and the creator and consumer must use a separate line to communicate the error – which is not very convenient!
Indeed, a separate channel has to be used.
I've documented and written tests for the current behavior in the attached commit. Fixing the quirk with push-streams, or deciding what is the correct way to deal with exceptions, is left for #250. This issue is linked from there as well.
Consider a stream created of a
Lwt_stream.from
orLwt_stream.from_direct
. How are exceptions raised by the function creating stream's elements handled? How can the stream consumer arrange to be noticed about them?I guess or would expect that the exception is conveyed by a failed thread returned by
Lwt_stream.get
, but the API-documentation does not go into these details.Consider a stream created with
Let_stream.create()
how can the producer notify an error to the stream consumer? It seems that there is no provision for this and the creator and consumer must use a separate line to communicate the error – which is not very convenient!Thanks!
The text was updated successfully, but these errors were encountered: