emit
ErrorsCollection

emit

Synthesised documentation from type/independent-routines type/Mu type/Supplier

From type/independent-routines

See Original text in context

sub emit(\value --> Nil)

If used outside any supply or react block, throws an exception emit without supply or react. Within a Supply block, it will add a message to the stream.

my $supply = supply {
  for 1 .. 10 {
      emit($_);
  }
}
$supply.tap-> $v { say "First : $v" });

See also the page for emit methods.

From type/Mu

See Original text in context

method emit()

Emits the invocant into the enclosing supply or react block.

react { whenever supply { .emit for "foo"42.5 } {
    say "received {.^name} ($_)";
}}
 
# OUTPUT: 
# received Str (foo) 
# received Int (42) 
# received Rat (0.5)

From type/Supplier

See Original text in context

method emit(Supplier:D: Mu \value)

Sends the given value to all of the taps on all of the supplies created by Supply on this Supplier.