ChainGraph API Documentation / @badaitech/chaingraph-channel / types / InMemoryChannelConfig
Interface: InMemoryChannelConfig
Defined in: types/ChannelConfig.d.ts:41
Configuration for InMemoryChannel.
Extends
Properties
cleanupStrategy?
optionalcleanupStrategy:BufferCleanupStrategy
Defined in: types/ChannelConfig.d.ts:28
Buffer cleanup strategy when maxBufferSize is reached.
- min-position: Keep items from slowest subscriber forward (fair to all)
- sliding-window: Always keep last N items (simple, may drop slow consumers)
- time-based: Remove items older than maxBufferAge
- none: No cleanup (unbounded growth)
Default
'min-position'Inherited from
BaseChannelConfig.cleanupStrategy
initialCapacity?
optionalinitialCapacity:number
Defined in: types/ChannelConfig.d.ts:58
Initial buffer capacity (performance optimization).
Pre-allocates array to avoid repeated resizing.
Default
maxBufferSize or 100maxBufferAge?
optionalmaxBufferAge:number
Defined in: types/ChannelConfig.d.ts:36
Maximum age of buffered items in milliseconds (for time-based cleanup).
Only used when cleanupStrategy is 'time-based'.
Default
60000 (1 minute)Inherited from
BaseChannelConfig.maxBufferAge
maxBufferSize?
optionalmaxBufferSize:number
Defined in: types/ChannelConfig.d.ts:50
Maximum buffer size for in-memory storage.
When exceeded, triggers buffer cleanup based on cleanupStrategy. Set to 0 for unbounded (not recommended for long-running streams).
Default
1000