Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-channel / memory

memory

Examples

typescript
import { InMemoryChannel } from '@badaitech/chaingraph-channel/memory'

const channel = new InMemoryChannel<Message>({ maxBufferSize: 100 })

// Stream data in browser
for await (const msg of channel) {
  displayMessage(msg)
}
typescript
import { InMemoryChannel } from '@badaitech/chaingraph-channel/memory'

const channel = new InMemoryChannel<Event>({ maxBufferSize: 1000 })

// High-performance local streaming
await channel.sendBatch(events)

Classes

Variables

References

BufferCleanupStrategy

Re-exports BufferCleanupStrategy


ChannelLogger

Re-exports ChannelLogger


ChannelStats

Re-exports ChannelStats


IChannel

Re-exports IChannel


InMemoryChannelConfig

Re-exports InMemoryChannelConfig

Licensed under BUSL-1.1