Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Split off .rotor from .buffering
  • Loading branch information
lizmat committed Apr 21, 2014
1 parent 692aa10 commit dda1c40
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions S17-concurrency.pod
Expand Up @@ -601,16 +601,21 @@ L<List.squish>).

my $b = $s.buffering( :elems(100), :seconds(1) );

my $b = $s.buffering( :elems(2), :overlap(1) );

Produces a C<Supply> that buffers the values of the given Supply by either
the number of elements (using the C<elems> named parameter) or the maximum
number of seconds (using the C<seconds> named parameter) or both.
number of seconds (using the C<seconds> named parameter) or both. Values
are grouped in a single array element when flushed.

=item rotor

my $b = $s.rotor( $elems, $overlap );

Or produces a "rotoring" C<Supply> where the last elements (as specified by
the C<overlap> named parameter) are kept when the buffer is flushed.
my $b = $s.rotor; # elems = 2, overlap = 1

Values are grouped in a single array element when flushed.
Produces a "rotoring" C<Supply> where every C<elems> number of elements are
combined, and the last C<overlap> elements of such a combination become the
initial elements of the next combination. This can e.g. be used to convert
a C<Supply> of coordinates into a C<Supply> of begin/end points.

=item delayed

Expand Down

0 comments on commit dda1c40

Please sign in to comment.