We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The current documentation is as follows:
val get : 'a t -> 'a option Lwt.t (** [get st] removes and returns the first element of the stream, if any. *)
val get_available : 'a t -> 'a list (** [get_available st] returns all available elements of [l] without blocking. *)
One may think that get_available doesn't remove the elements, but it seems that it actually does (assuming removal is done by consume):
get_available
consume
let rec get_available_rec node acc s = if node == !(s.last) then let thread = feed s in match Lwt.state thread with | Lwt.Return _ -> get_available_rec node acc s | Lwt.Fail exn -> raise exn | Lwt.Sleep -> List.rev acc else match node.data with | Some x -> consume s node; get_available_rec node.next (x :: acc) s | None -> List.rev acc
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The current documentation is as follows:
One may think that
get_available
doesn't remove the elements, but it seems that it actually does (assuming removal is done byconsume
):The text was updated successfully, but these errors were encountered: