Skip to content

Chat SDK now supports concurrent message handling

1 min read

Chat SDK now lets you control what happens when a new message arrives before a previous one finishes processing, with the new concurrency option for the Chat class.

const bot = new Chat({
concurrency: {
strategy: "queue",
maxQueueSize: 20,
onQueueFull: "drop-oldest",
queueEntryTtlMs: 60_000,
},
// ...
});

Multiple options are supported to customize the feature's functionality.

Four strategies are available:

  • drop (default): discards new messages

  • queue: processes the latest message after the handler finishes

  • debounce: waits for a pause in conversation, processes only the final message

  • concurrent: processes every message immediately, no locking

Read the documentation to get started.