Repository navigation
Add transaction and connection APIs - #250
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the following APIs while preserving existing defaults and return values. No version bump.
New APIs
AMQP.Transaction.select(channel)AMQP.Transaction.commit(channel)AMQP.Transaction.rollback(channel)AMQP.Connection.info(connection, keys)ArgumentErrorwithout closing the connectionAMQP.Connection.info_keys()AMQP.Connection.info_keys(connection)AMQP.Connection.connection_name(connection):undefinedAMQP.Connection.register_blocked_handler(connection, pid){:"connection.blocked", reason}and{:"connection.unblocked"}notificationsAMQP.Connection.close(connection, timeout)AMQP.Connection.close(connection, code, text)AMQP.Connection.close(connection, code, text, timeout)AMQP.Channel.close(channel, code, text)AMQP.Queue.purge(channel, queue, options):nowaitor:no_waitAMQP.Confirm.select(channel, options):nowaitor:no_waitNew Options
:nowaitand its alias:no_waitdefault tofalsefor queue purge and confirm selection. Setting either totrueskips the broker reply and returns:okafter sending the request.Queue.purge/2still returns the message count;Confirm.select/1still waits for the broker reply.Internal
AMQP.Corerecord macros added:tx_select,tx_select_ok,tx_commit,tx_commit_ok,tx_rollback, andtx_rollback_ok.Blocked-handler documentation covers the upstream monitor limitation when replacing handlers.
Validation: 84 tests pass with amqp_client 4.3.4 and 4.2.1; formatting and diff checks pass.