ThroughputDispatcher
Defined in: src/Dispatcher.ts:57
Processes up to throughput queued units synchronously before yielding.
Useful when actors exchange many small messages and you want less
scheduling overhead. Be aware that you can starve the event loop if
throughput is set high.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ThroughputDispatcher(
throughput?,id?):ThroughputDispatcher
Defined in: src/Dispatcher.ts:62
Parameters
Section titled “Parameters”throughput?
Section titled “throughput?”number = 16
string = 'throughput-dispatcher'
Returns
Section titled “Returns”ThroughputDispatcher
Properties
Section titled “Properties”
readonlyid:string
Defined in: src/Dispatcher.ts:58
Implementation of
Section titled “Implementation of”throughput
Section titled “throughput”
readonlythroughput:number=16
Defined in: src/Dispatcher.ts:62
Methods
Section titled “Methods”execute()
Section titled “execute()”execute(
fn):void
Defined in: src/Dispatcher.ts:66
Schedule a unit of work to be executed asynchronously.
Parameters
Section titled “Parameters”() => void | Promise<void>
Returns
Section titled “Returns”void