Skip to content

Commit

Permalink
Add missing timeout property to type. (#77)
Browse files Browse the repository at this point in the history
* Add missing timeout property to type.

* 0.16.4

* Add comments for options.
  • Loading branch information
ramhr committed May 8, 2024
1 parent ba024b4 commit 6a94f64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arnavmq",
"version": "0.16.3",
"version": "0.16.4",
"description": "ArnavMQ is a RabbitMQ wrapper",
"keywords": [
"rabbitmq",
Expand Down
7 changes: 7 additions & 0 deletions types/modules/producer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6a94f64

Please sign in to comment.