Bonsai_proc.Effect_throttlingmodule Poll_result : sig ... endval poll :
here:lexing_position ->
('a -> 'b Effect.t) Value.t ->
('a -> 'b Poll_result.t Effect.t) Computation.tTransforms an input effect into a new effect that enforces that invariant that at most one instance of the effect is running at once. Attempting to run the effect while a previous run is still ongoing will cause the new effect to be enqueued. Any previously enqueued item gets kicked out, thus maintaining the invariant that at most one effect will be enqueued. (this is important so that things like RPCs calls don't pile up)
CAUTION: This computation assumes that the input effect will always complete. If a run of the effect raises, no more runs will ever get executed, since they will all be waiting for the one that raised to complete.