From 6a94f64b8a1bdfcae402ca83a93c32594d39022d Mon Sep 17 00:00:00 2001 From: Ram Hershberg <57596294+ramhr@users.noreply.github.com> Date: Wed, 8 May 2024 15:36:04 +0300 Subject: [PATCH] Add missing timeout property to type. (#77) * Add missing timeout property to type. * 0.16.4 * Add comments for options. --- package.json | 2 +- types/modules/producer.d.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9fa7e78..086d75a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arnavmq", - "version": "0.16.3", + "version": "0.16.4", "description": "ArnavMQ is a RabbitMQ wrapper", "keywords": [ "rabbitmq", diff --git a/types/modules/producer.d.ts b/types/modules/producer.d.ts index 6fc9c30..ea0e1eb 100644 --- a/types/modules/producer.d.ts +++ b/types/modules/producer.d.ts @@ -8,8 +8,15 @@ declare class ProducerError extends Error { } interface ProduceOptions extends amqp.Options.Publish { + /** + * When provided, will publish instead of sending to queue, with the given `queue` parameter serving as the exchange and this as the routing key. + * When sending to the default exchange, it is the same as not passing the option: `producer.produce('', "message", {routingKey:"my-queue"})` is the same as `producer.produce('my-queue', "message")` + */ routingKey?: string; + /** When true, will produce the request with RPC settings, waiting for a response on a dedicated response queue after sending the message, and finally returning it. */ rpc?: boolean; + /** Timeout in milliseconds for producing RPC request and waiting for the response. Does not affect non-rpc requests. */ + timeout?: number; } declare class Producer {