module Collector:sig
..end
type ('a, 'b)
t = {
|
collect : |
|
wait : |
Collectors are refinements of countdowns, which collect and
combine n
partial results (type 'a
) into a final result
(type 'b
). Given a collector c
for n
events, with
combining function comb
and initial result y0
:
n
events, x1
,...,xn
, are sent as n
messages
on c.collect
. Notice that the notation xi
does
not imply any kind of ordering.c.wait()
returns the
value comb x1 (comb x2 (... (comb xn y0)))
.
Again, at most one call c.wait()
returns.val create : ('a -> 'b -> 'b) -> 'b -> int -> ('a, 'b) t
create comb y0 n
returns a collector of n
events of type 'a
, with combining function comb
and initial
result y0
.