UNPKG

transgate

Version:

Agent-based task flow framework

30 lines (29 loc) 825 B
import { GateItem, InGate } from '../gate/type'; /** * Merging items from gates for Input */ export declare class Mixer<T extends GateItem> { private _buffer; private _runnerAliveSet; private _runners; /** * @param {...Gate} outGates - source gates */ constructor(...inGates: InGate<T>[]); /** * execute. */ run(): Promise<void[]>; /** * @return {Promise<object>} - A promise that resolves the item when recevied */ receive(): Promise<T | null>; _createRunner(gate: InGate<T>, idx: number): Promise<void>; _destroyRunner(idx: number): Promise<void>; } /** * Merging items from gates for Input * @param {...Gate} outGates - source gates * @return {Mixer} */ export declare function mixer<T extends GateItem>(...inGates: InGate<T>[]): Mixer<T>;