@ts-drp/message-queue
v0.11.0
Published
A lightweight, in-memory channel-based message queue implementation for efficient message passing and processing.
Readme
Channel-Based Message Queue
A lightweight, in-memory channel-based message queue implementation for efficient message passing and processing.
Features
- Channel-based message passing
- Non-blocking publish/subscribe pattern
- Type-safe message handling
- In-memory message storage
- Async/await support
MessageQueue<T>
enqueue(message: T): Promise<void>- Enqueues a message to the queuesubscribe(handler: (message: T) => Promise<void>): void- Subscribes to messagesclose(): void- Closes the queue
MessageQueueManager<T>
enqueue(queueId: string, message: T): Promise<void>- Enqueues a message to the queue for the given queue IDsubscribe(queueId: string, handler: (message: T) => Promise<void>): void- Subscribes to messages for the given queue IDclose(queueId: string): void- Closes the queue for the given queue IDcloseAll(): void- Closes all queues
