IMessageQueue.clear() method
Deletes this queue's pending messages — both the main list and the delayed set for <prefix>:<name>.
Signature:
clear(): Promise<IMessageQueue>;
Returns:
Promise<IMessageQueue>
this queue instance
Remarks
Other queues in the namespace, the watcher lock, and messages currently leased to a worker under IMQOptions.safeDelivery are all untouched — a leased message can be re-queued by the watcher once its lease expires, so this does not guarantee the queue stays empty.
It never rejects: with no writer connection it silently does nothing, and host failures are logged rather than raised, so success cannot be inferred from a resolved promise.
Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.