-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more useful type exports. #70
Conversation
@@ -7,7 +7,7 @@ declare class ProducerError extends Error { | |||
constructor(error: { name: string; message: string }); | |||
} | |||
|
|||
interface PublishOptions extends amqp.Options.Publish { | |||
interface ProduceOptions extends amqp.Options.Publish { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We said we want to deprecate "publish" in favor of "produce", even though currently "produce" is marked deprecated, so I the exported type to "produce".
@@ -7,7 +7,7 @@ declare class ProducerError extends Error { | |||
constructor(error: { name: string; message: string }); | |||
} | |||
|
|||
interface PublishOptions extends amqp.Options.Publish { | |||
interface ProduceOptions extends amqp.Options.Publish { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to decide, which is of the ones we shoul depricate: either Publish/Subscribe
or Produce/Consume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be produce / consume, this is how RabbitMQ clients call it.
Maybe let's deprecate publish / subscribe in our next version?
@@ -7,7 +7,7 @@ declare class ProducerError extends Error { | |||
constructor(error: { name: string; message: string }); | |||
} | |||
|
|||
interface PublishOptions extends amqp.Options.Publish { | |||
interface ProduceOptions extends amqp.Options.Publish { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be produce / consume, this is how RabbitMQ clients call it.
Maybe let's deprecate publish / subscribe in our next version?
types/modules/producer.d.ts
Outdated
@@ -45,7 +45,7 @@ declare class Producer { | |||
* @param msg The message to publish | |||
* @param options The publish options | |||
*/ | |||
publishOrSendToQueue(queue: string, msg: Buffer, options: PublishOptions): Promise<boolean>; | |||
publishOrSendToQueue(queue: string, msg: Buffer, options: ProduceOptions): Promise<boolean>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method should be private I think
The argument type for the produce and consume functions were not exported, and so was the type of the
Arnavmq
object itself.