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
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.
The text was updated successfully, but these errors were encountered:
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 forcreate
which creates the push function with type'a option -> unit
and it is not clear whyoption
is used.Related to this, the documentation for
get
is: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 valuev
is available, in which caseSome v
is "returned". Andget
"returns"None
if the stream is closed.I can do a PR if I'm not wrong about the above.
The text was updated successfully, but these errors were encountered: