Skip to content

FCO/SupplyTimeWindow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%