High-level summary of notable changes:
- Change to 3-Clause BSD License
- Python 3.x support
- Over 150 commits from 19 contributors
- Refactoring of SelectConnection ioloop
- This major release contains certain non-backward-compatible API
changes as well as significant performance improvements in the
[BlockingConnection]{.title-ref} adapter.
- Non-backward-compatible changes in
[Channel.add_on_return_callback]{.title-ref} callback\'s signature.
- The [AsyncoreConnection]{.title-ref} adapter was retired
**Details**
Python 3.x: this release introduces python 3.x support. Tested on Python
3.3 and 3.4.
\`AsyncoreConnection\`: Retired this legacy adapter to reduce
maintenance burden; the recommended replacement is the
[SelectConnection]{.title-ref} adapter.
\`SelectConnection\`: ioloop was refactored for compatibility with other
ioloops.
\`Channel.add_on_return_callback\`: The callback is now passed the
individual parameters channel, method, properties, and body instead of a
tuple of those values for congruence with other similar callbacks.
\`BlockingConnection\`: This adapter underwent a makeover under the hood
and gained significant performance improvements as well as enhanced
timer resolution. It is now implemented as a client of the
[SelectConnection]{.title-ref} adapter.
Below is an overview of the [BlockingConnection]{.title-ref} and
[BlockingChannel]{.title-ref} API changes:
> - Recursion: the new implementation eliminates callback recursion
> that sometimes blew out the stack in the legacy implementation
> (e.g., publish -\> consumer_callback -\> publish -\>
> consumer_callback, etc.). While
> [BlockingConnection.process_data_events]{.title-ref} and
> [BlockingConnection.sleep]{.title-ref} may still be called from
> the scope of the blocking adapter\'s callbacks in order to process
> pending I/O, additional callbacks will be suppressed whenever
> [BlockingConnection.process_data_events]{.title-ref} and
> [BlockingConnection.sleep]{.title-ref} are nested in any
> combination; in that case, the callback information will be
> bufferred and dispatched once nesting unwinds and control returns
> to the level-zero dispatcher.
>
> - \`BlockingConnection.connect\`: this method was removed in favor
> of the constructor as the only way to establish connections; this
> reduces maintenance burden, while improving reliability of the
> adapter.
>
> - \`BlockingConnection.process_data_events\`: added the optional
> parameter [time_limit]{.title-ref}.
>
> - \`BlockingConnection.add_on_close_callback\`: removed; legacy
> raised [NotImplementedError]{.title-ref}.
>
> - \`BlockingConnection.add_on_open_callback\`: removed; legacy
> raised [NotImplementedError]{.title-ref}.
>
> - \`BlockingConnection.add_on_open_error_callback\`: removed; legacy
> raised [NotImplementedError]{.title-ref}.
>
> - \`BlockingConnection.add_backpressure_callback\`: not supported
>
> - \`BlockingConnection.set_backpressure_multiplier\`: not supported
>
> - \`BlockingChannel.add_on_flow_callback\`: not supported; per
> docstring in channel.py: \"Note that newer versions of RabbitMQ
> will not issue this but instead use TCP backpressure\".
>
> - \`BlockingChannel.flow\`: not supported
>
> - \`BlockingChannel.force_data_events\`: removed as it is no longer
> necessary following redesign of the adapter.
>
> - Removed the [nowait]{.title-ref} parameter from
> [BlockingChannel]{.title-ref} methods, forcing
> [nowait=False]{.title-ref} (former API default) in the
> implementation; this is more suitable for the blocking nature of
> the adapter and its error-reporting strategy; this concerns the
> following methods: [basic_cancel]{.title-ref},
> [confirm_delivery]{.title-ref}, [exchange_bind]{.title-ref},
> [exchange_declare]{.title-ref}, [exchange_delete]{.title-ref},
> [exchange_unbind]{.title-ref}, [queue_bind]{.title-ref},
> [queue_declare]{.title-ref}, [queue_delete]{.title-ref}, and
> [queue_purge]{.title-ref}.
>
> - \`BlockingChannel.basic_cancel\`: returns a sequence instead of
> None; for a [no_ack=True]{.title-ref} consumer,
> [basic_cancel]{.title-ref} returns a sequence of pending messages
> that arrived before broker confirmed the cancellation.
>
> - \`BlockingChannel.consume\`: added new optional kwargs
> [arguments]{.title-ref} and [inactivity_timeout]{.title-ref}.
> Also, raises ValueError if the consumer creation parameters don\'t
> match those used to create the existing queue consumer generator,
> if any; this happens when you break out of the consume loop, then
> call [BlockingChannel.consume]{.title-ref} again with different
> consumer-creation args without first cancelling the previous queue
> consumer generator via [BlockingChannel.cancel]{.title-ref}. The
> legacy implementation would silently resume consuming from the
> existing queue consumer generator even if the subsequent
> [BlockingChannel.consume]{.title-ref} was invoked with a different
> queue name, etc.
>
> - \`BlockingChannel.cancel\`: returns 0; the legacy implementation
> tried to return the number of requeued messages, but this number
> was not accurate as it didn\'t include the messages returned by
> the Channel class; this count is not generally useful, so
> returning 0 is a reasonable replacement.
>
> - \`BlockingChannel.open\`: removed in favor of having a single
> mechanism for creating a channel
> ([BlockingConnection.channel]{.title-ref}); this reduces
> maintenance burden, while improving reliability of the adapter.
>
> - \`BlockingChannel.confirm_delivery\`: raises UnroutableError when
> unroutable messages that were sent prior to this call are returned
> before we receive Confirm.Select-ok.
>
> - [BlockingChannel.basic_publish: always returns True when delivery
> confirmation is not enabled (publisher-acks = off); the legacy
> implementation returned a bool in this case if
> \`mandatory=True]{.title-ref} to indicate whether the message was
> delivered; however, this was non-deterministic, because
> Basic.Return is asynchronous and there is no way to know how long
> to wait for it or its absence. The legacy implementation returned
> None when publishing with publisher-acks = off and
> [mandatory=False]{.title-ref}. The new implementation always
> returns True when publishing while publisher-acks = off.
>
> -
>
> \`BlockingChannel.publish\`: a new alternate method (vs. [basic_publish]{.title-ref}) for
>
> : publishing a message with more detailed error reporting via
> UnroutableError and NackError exceptions.
>
> - \`BlockingChannel.start_consuming\`: raises
> pika.exceptions.RecursionError if called from the scope of a
> [BlockingConnection]{.title-ref} or [BlockingChannel]{.title-ref}
> callback.
>
> - \`BlockingChannel.get_waiting_message_count\`: new method; returns
> the number of messages that may be retrieved from the current
> queue consumer generator via [BasicChannel.consume]{.title-ref}
> without blocking.
**Commits**
> - 5aaa753 - Fixed SSL import and removed no_ack=True in favor of
> explicit AMQP message handling based on deferreds (skftn)
> - 7f222c2 - Add checkignore for codeclimate (Gavin M. Roy)
> - 4dec370 - Implemented BlockingChannel.flow; Implemented
> BlockingConnection.add_on_connection_blocked_callback; Implemented
> BlockingConnection.add_on_connection_unblocked_callback. (Vitaly
> Kruglikov)
> - 4804200 - Implemented blocking adapter acceptance test for
> exchange-to-exchange binding. Added rudimentary validation of
> BasicProperties passthru in blocking adapter publish tests.
> Updated CHANGELOG. (Vitaly Kruglikov)
> - 4ec07fd - Fixed sending of data in TwistedProtocolConnection
> (Vitaly Kruglikov)
> - a747fb3 - Remove my copyright from forward_server.py test utility.
> (Vitaly Kruglikov)
> - 94246d2 - Return True from basic_publish when pubacks is off.
> Implemented more blocking adapter accceptance tests. (Vitaly
> Kruglikov)
> - 3ce013d - PIKA-609 Wait for broker to dispatch all messages to
> client before cancelling consumer in
> TestBasicCancelWithNonAckableConsumer and
> TestBasicCancelWithAckableConsumer (Vitaly Kruglikov)
> - 293f778 - Created CHANGELOG entry for release 0.10.0. Fixed up
> callback documentation for basic_get, basic_consume, and
> add_on_return_callback. (Vitaly Kruglikov)
> - 16d360a - Removed the legacy AsyncoreConnection adapter in favor
> of the recommended SelectConnection adapter. (Vitaly Kruglikov)
> - 240a82c - Defer creation of poller\'s event loop interrupt socket
> pair until start is called, because some SelectConnection users
> (e.g., BlockingConnection adapter) don\'t use the event loop, and
> these sockets would just get reported as resource leaks. (Vitaly
> Kruglikov)
> - aed5cae - Added EINTR loops in select_connection pollers.
> Addressed some pylint findings, including an error or two. Wrap
> socket.send and socket.recv calls in EINTR loops Use the correct
> exception for socket.error and select.error and get errno
> depending on python version. (Vitaly Kruglikov)
> - 498f1be - Allow passing exchange, queue and routing_key as text,
> handle short strings as text in python3 (saarni)
> - 9f7f243 - Restored basic_consume, basic_cancel, and
> add_on_cancel_callback (Vitaly Kruglikov)
> - 18c9909 - Reintroduced BlockingConnection.process_data_events.
> (Vitaly Kruglikov)
> - 4b25cb6 - Fixed BlockingConnection/BlockingChannel acceptance and
> unit tests (Vitaly Kruglikov)
> - bfa932f - Facilitate proper connection state after
> BasicConnection.\_adapter_disconnect (Vitaly Kruglikov)
> - 9a09268 - Fixed BlockingConnection test that was failing with
> ConnectionClosed error. (Vitaly Kruglikov)
> - 5a36934 - Copied synchronous_connection.py from pika-synchronous
> branch Fixed pylint findings Integrated SynchronousConnection with
> the new ioloop in SelectConnection Defined dedicated message
> classes PolledMessage and ConsumerMessage and moved from
> BlockingChannel to module-global scope. Got rid of nowait args
> from BlockingChannel public API methods Signal unroutable messages
> via UnroutableError exception. Signal Nack\'ed messages via
> NackError exception. These expose more information about the
> failure than legacy basic_publich API. Removed set_timeout and
> backpressure callback methods Restored legacy
> [is_open]{.title-ref}, etc. property names (Vitaly Kruglikov)
> - 6226dc0 - Remove deprecated \--use-mirrors (Gavin M. Roy)
> - 1a7112f - Raise ConnectionClosed when sending a frame with no
> connection (439) (Gavin M. Roy)
> - 9040a14 - Make delivery_tag non-optional (498) (Gavin M. Roy)
> - 86aabc2 - Bump version (Gavin M. Roy)
> - 562075a - Update a few testing things (Gavin M. Roy)
> - 4954d38 - use unicode_type in blocking_connection.py (Antti
> Haapala)
> - 133d6bc - Let Travis install ordereddict for Python 2.6, and ttest