Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
t
 
 
 
 
 
 
 
 

Build Status

SupplyTimeWindow

use SupplyTimeWindow;

my $s = Supplier.new;
my $t = $s.Supply.time-window: 1;

start react whenever $t { .say }
                                
for ^10 -> $i { $s.emit: $i; sleep .5.rand }

SupplyTimeWindow creates time-window() new method on Supplyies that receives the size of the time window in seconds. Every time the original Supply emits, it will emit an Array with each value emitted less than time window's size seconds.

multi method time-window($seconds --> Supply) {...}

It also accepts a optional named parameter transform, it's a Callable that will be used to transform the time window array.

multi method time-window($seconds, :&transform! --> Supply) {...}

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%