Module Async_bus
Async operations on Core_kernel.Bus.
val pipe1_exn : ('a -> unit, [> Core_kernel.read ]) Core_kernel.Bus.t -> Core_kernel.Source_code_position.t -> 'a Async_kernel.Pipe.Reader.tpipe1_exn treturns a pipe of updates fromtby subscribing tot. Closing the pipe unsubscribes fromt. Closingtcloses the pipe.pipe1_exnraises in the same circumstances assubscribe_exn.
module First_arity : sig ... endval first_exn : ?stop:unit Async_kernel.Deferred.t -> ('c, [> Core_kernel.read ]) Core_kernel.Bus.t -> Core_kernel.Source_code_position.t -> ('c, 'f, 'r) First_arity.t -> f:'f -> 'r Async_kernel.Deferred.tfirst_exn here t arity ~freturns a deferred that becomes determined with valuerwhen the first event is published totwherefreturnsSome r.first_exnthen unsubscribes fromt, ensuring thatfis never called again after it returnsSome.first_exnraises if it can't subscribe to the bus, i.e., ifsubscribe_exnraises. Iffraises, thenfirst_exnraises to the monitor in effect whenfirst_exnwas called.first_exntakes time proportional to the number of bus subscribers.If
stopis provided and becomes determined,fwill not be called again, it will unsubscribe from the bus, and the deferred that was returned byfirst_exnwill never become determined.