skip to content

pool

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { kefirObserver } = require('api/v0.3');
const Kefir = require('kefir');

let a,b,c;

a = Kefir.sequentially(100, [0, 1, 2]);
b = Kefir.sequentially(100, [0, 1, 2]).delay(30);
c = Kefir.sequentially(100, [0, 1, 2]).delay(60);

const pool = Kefir.pool();

pool.plug(a);
pool.plug(b);
pool.plug(c);

a.observe(kefirObserver());
b.observe(kefirObserver());
c.observe(kefirObserver());
pool.observe(kefirObserver('pool'));

0msstartcomplete00 11 22 startcomplete00 11 22 startcomplete00 11 22 poolstart00 00 00 11 11 11 22 22 22