Live Supply factory
This is a factory for live Supply objects, which provides the mechanism for emitting new values onto the supplies:
my = Supplier.new;my = .Supply;.tap(-> );my = .Supply;.tap(-> );.emit(42);
One 42Two 42
method Supply(Supplier: --> Supply)
This creates a new
Supply object to which any values which are emitted on this supplier are passed. This is the factory for all
method emit(Supplier: Mu \value)
Sends the given value to all of the taps on all of the supplies created by
Supply on this
done callback on all the taps that have one.
my = Supplier.new;my = .Supply;.tap(-> , done => );.emit(42);.done;
42no more answers
multi method quit(Supplier: Exception )multi method quit(Supplier: Str() )
This is meant for shutting down a supply with an error.