Skip to content

Commit

Permalink
Docs: clarify Lwt_stream.wrap_exn s when s fails
Browse files Browse the repository at this point in the history
Related ocsigen#265.

[skip ci]
  • Loading branch information
aantron committed Dec 6, 2016
1 parent e7a6755 commit eb64c25
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/lwt_stream.mli
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ val wrap_exn : 'a t -> 'a Lwt.result t
[s'] yields [Result.Ok v], and when the source of [s] raises an exception
[e], [s'] yields [Result.Error e].
Note that push-streams (as returned by {!create}) never raise exceptions. *)
Note that push-streams (as returned by {!create}) never raise exceptions.
If the stream source keeps raising the same exception [e] each time the
stream is read, [s'] is unbounded. Reading it will produce [Result.Error e]
indefinitely. *)

(** {2 Parsing} *)

Expand Down Expand Up @@ -392,6 +396,10 @@ val map_exn : 'a t -> 'a result t
Note that for push-streams (as returned by {!create}) all
elements of the mapped streams are values.
If the stream source keeps raising the same exception [e] each time the
stream is read, the stream produced by [map_exn] is unbounded. Reading it
will produce [Lwt_stream.Error e] indefinitely.
@deprecated Use {!wrap_exn}. *)

[@@@ocaml.warning "+3"]

0 comments on commit eb64c25

Please sign in to comment.