Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-channel / types / InMemoryChannelConfig

Interface: InMemoryChannelConfig ​

Defined in: types/ChannelConfig.d.ts:41

Configuration for InMemoryChannel.

Extends ​

Properties ​

cleanupStrategy? ​

optional cleanupStrategy: 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 ​

ts
'min-position'

Inherited from ​

BaseChannelConfig.cleanupStrategy


initialCapacity? ​

optional initialCapacity: number

Defined in: types/ChannelConfig.d.ts:58

Initial buffer capacity (performance optimization).

Pre-allocates array to avoid repeated resizing.

Default ​

ts
maxBufferSize or 100

maxBufferAge? ​

optional maxBufferAge: 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 ​

ts
60000 (1 minute)

Inherited from ​

BaseChannelConfig.maxBufferAge


maxBufferSize? ​

optional maxBufferSize: 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 ​

ts
1000

Overrides ​

BaseChannelConfig.maxBufferSize

Licensed under BUSL-1.1