Open
Description
It seems that pushing None
to a stream closes the stream. I think this not said, and it could be said in the doc-string for create
which creates the push function with type 'a option -> unit
and it is not clear why option
is used.
Related to this, the documentation for get
is:
(** [get st] removes and returns the first element of the stream, if
any. *)
This implies that if the stream is empty, then None
is returned immediately (as a fulfilled promise).
But, AFAIU, that's not the semantics of get
. If the stream is empty, get
"blocks" until either a value v
is available, in which case Some v
is "returned". And get
"returns" None
if the stream is closed.
I can do a PR if I'm not wrong about the above.
Metadata
Assignees
Labels
No labels