Binner
Bins a stream of events to a new stream of events with a fixed frequency.
Constructor Summary
Public Constructor | ||
public |
constructor(size: *, processor: *, observer: *) |
Method Summary
Public Methods | ||
public |
addEvent(event: *) Add an event, which will be assigned to a bucket. |
|
public |
flush() Forces the current buckets to emit |
|
public |
getEdgeValues(range: *, v1: *, v2: *, intersection: *): * |-range -----------| |
|
public |
incrementActiveBucketList(timestamp: *): * Gets the current bucket or returns a new one. |
|
public |
onEmit(cb: *) Set the emit callback after the constructor |
Public Constructors
public constructor(size: *, processor: *, observer: *) source
Params:
Name | Type | Attribute | Description |
size | * | ||
processor | * | ||
observer | * |
Public Methods
public addEvent(event: *) source
Add an event, which will be assigned to a bucket. TODO: If we make the cache more general we should pass in a callback here.
Params:
Name | Type | Attribute | Description |
event | * |
public getEdgeValues(range: *, v1: *, v2: *, intersection: *): * source
|-range -----------| |-bucket------------| | x | - v2 | | o | - va x | | - v1 |-intersect--| |
Params:
Name | Type | Attribute | Description |
range | * | ||
v1 | * | ||
v2 | * | ||
intersection | * |
Return:
* |
public incrementActiveBucketList(timestamp: *): * source
Gets the current bucket or returns a new one.
If a new bucket is generated the result of the old bucket is emitted automatically.
Params:
Name | Type | Attribute | Description |
timestamp | * |
Return:
* |
public onEmit(cb: *) source
Set the emit callback after the constructor
Params:
Name | Type | Attribute | Description |
cb | * |