Reference

createEventResource

Creates a bounded event stream. Overflow evicts oldest events and reports their count.

Signature

function createEventResource<TKey, TEvent>(subscribe: (key: TKey, emit: (event: TEvent): void): (): void, options: { capacity: number }): EventResource<TKey, TEvent>