Skip to content

Commit 96be575

Browse files
committed
spaces not tabs
1 parent 04779c1 commit 96be575

File tree

1 file changed

+35
-36
lines changed

1 file changed

+35
-36
lines changed

doc/Language/concurrency.pod

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -424,49 +424,48 @@ C<react> block described earlier:
424424
my $channel = Channel.new;
425425
426426
my $p = start {
427-
react {
428-
whenever $channel {
429-
say $_;
430-
}
431-
}
432-
}
433-
434-
await (^10).map: -> $r {
435-
start {
436-
sleep $r;
437-
$channel.send($r);
438-
}
439-
}
440-
441-
$channel.close;
442-
await $p;
427+
react {
428+
whenever $channel {
429+
say $_;
430+
}
431+
}
432+
}
433+
434+
await (^10).map: -> $r {
435+
start {
436+
sleep $r;
437+
$channel.send($r);
438+
}
439+
}
440+
441+
$channel.close;
442+
await $p;
443443
444444
It is also possible to obtain a L<Channel> from a L<Supply> using the
445445
L<Supply method|/type/Supply#method_Channel> which returns a L<Channel>
446446
which is fed by a C<tap> on the L<Supply>:
447447
448-
my $supplier = Supplier.new;
449-
my $supply = $supplier.Supply;
450-
my $channel = $supply.Channel;
448+
my $supplier = Supplier.new;
449+
my $supply = $supplier.Supply;
450+
my $channel = $supply.Channel;
451451
452+
my $p = start {
453+
react {
454+
whenever $channel -> $item {
455+
say "via Channel: $item";
456+
}
457+
}
458+
}
452459
453-
my $p = start {
454-
react {
455-
whenever $channel -> $item {
456-
say "via Channel: $item";
457-
}
458-
}
459-
}
460-
461-
await (^10).map: -> $r {
462-
start {
463-
sleep $r;
464-
$supplier.emit($r);
465-
}
466-
}
467-
468-
$supplier.done;
469-
await $p;
460+
await (^10).map: -> $r {
461+
start {
462+
sleep $r;
463+
$supplier.emit($r);
464+
}
465+
}
466+
467+
$supplier.done;
468+
await $p;
470469
471470
C<Channel> will return a different L<Channel> fed with the same data
472471
each time it is called. This could be used, for instance, to fan-out a

0 commit comments

Comments
 (0)