Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: mq.rb
- ===================================================================
- --- mq.rb (revision 13616)
- +++ mq.rb (working copy)
- @@ -221,6 +221,10 @@
- MQ.error "Basic.GetEmpty for invalid consumer"
- end
- + when Protocol::Tx::CommitOk
- + tx_callback = (@tx_callback ||= []).shift
- + tx_callback.call if tx_callback
- +
- when Protocol::Channel::Close
- raise Error, "#{method.reply_text} in #{Protocol.classes[method.class_id].methods[method.method_id]} on #{@channel}"
- @@ -736,6 +740,18 @@
- send Protocol::Basic::Qos.new(:prefetch_size => 0, :prefetch_count => size, :global => false)
- end
- + def transaction(block, commit_callback)
- + send Protocol::Tx::Select.new
- + begin
- + block.call
- + (@tx_callback ||= []) << commit_callback
- + send Protocol::Tx::Commit.new
- + rescue Object
- + send Protocol::Tx::Rollback.new
- + raise
- + end
- + end
- +
- # Returns a hash of all the exchange proxy objects.
- #
- # Not typically called by client code.
Add Comment
Please, Sign In to add comment