this makes it easier to use `PublishWithDeferredConfirmWithContext`
without generating a custom handler that does nothing.
Add an additional example for this that also shows how to use
PublishWithDeferredConfirmWithContext.
Closes: https://github.com/wagslane/go-rabbitmq/issues/116
- 'Publish' has been deprecared by rabbitmq/ampq091-go.
- 'PublishWithContext' has been introduced to pass context
while publishing for cancellation.
- Update examples to use PublishWithContext.
Signed-off-by: Aaqa Ishtyaq <aaqa@hackerrank.com>
It's the channel that never changes so we might
as well keep a copy of it (even to consider closing
it when the publisher is closed as well).
Also add another little buffer.
Also add a very small buffer to the NotifyReturn channel
in case no one is listening on the other side.
I event thought about actually having a timeout when sending
to that channel, but it felt it could lead to loss of
events on non problematic situations, so let's see how this
works instead.
- Added WithPublishOptionsExpiration which permits message expiry when the TTL has been reached
- Introduced new message var to permit the confidiontal injection of amp.Publishing options in the future.