Changelog¶
0.2.2 (2025-12-07)¶
Fixed¶
yapw.clients.Asynccloses the RabbitMQ connection regardless of themanage_ioloopargument.
0.2.1 (2025-11-20)¶
Added¶
yapw.clients.Asyncaccepts amanage_ioloopargument, to control whether the client manages the event loop (run, stop, signal handlers).
0.2.0 (2025-11-19)¶
Changed¶
yapw.clients.Asyncno longer raisesNotImplementedErrorif theexchange_readymethod isn’t overridden.
0.1.5 (2025-11-19)¶
Added¶
yapw.clients.Asyncaccepts acustom_ioloopargument, to pass topika.adapters.asyncio_connection.AsyncioConnection.yapw.clients.Asyncsets areadyattribute toTruebefore callingexchange_ready(). Usage:import functools from yapw import methods from yapw.clients import Async class Extension: def __init__(self): self.client = Async() def open(self): self.client.start() def write(self, message): cb = functools.partial(self.when_ready, self.client.publish, {"message": message}, "my_routing_key") methods.add_callback_threadsafe(self.client.connection, cb) def when_ready(self, callback, *args): if self.client.ready: callback(*args) else: self.client.connection.ioloop.call_soon(self.when_ready, callback, *args)
In this example, the
Extensionclass implements an imaginary framework’s extension API:open()andwrite(). It’s possible thatopen()is called (which begins a series of callbacks to declare an exchange), and thenwrite()is called before the exchange is declared. So, thewhen_readymethod checks whether the exchange is declared using the client’sreadyattribute; if not, it reschedules the callback at the next iteration of the event loop.
0.1.4 (2024-01-24)¶
Changed¶
Remove log message for declaring exchange.
Remove
yapw.clients.Base.__getsafe__.
Fixed¶
If the client attempts to close the connection while it is opening, do not retry opening the connection.
Reset the client’s state, before scheduling the reconnection, rather than immediately before reconnecting.
0.1.3 (2023-07-03)¶
Changed¶
yapw.clients.Async.connection_open_error_callback(): Don’t retry on authentication (e.g. incorrect username or password) or access denied (e.g. non-existent virtual host) errors.yapw.clients.Async.connection_close_callback(): Change log level fromERRORtoWARNING.yapw.clients.Async()log messages format errors with%rinstead of%s, to include information like the exception class.
0.1.2 (2023-07-02)¶
Added¶
Restore Python 3.10 support.
0.1.1 (2023-07-02)¶
Fixed¶
Fix logging of exchange type.
0.1.0 (2023-07-02)¶
Added¶
Changed¶
BREAKING CHANGES:
Use subclasses instead of mixins, to share logic between synchronous and asynchronous clients with less code.
Move
__init__arguments from other classes to theBaseclass.Move the
publishmethod from theBlockingclass to theBaseclass.Move and rename
install_signal_handlersfromyapw.ossignaltoyapw.clients.Base.add_signal_handlersclass.Move the
default_decodemethod from theyapw.decoratorsmodule to theyapw.utilmodule.Rename the
callbackpositional argument for the consumer callback toon_message_callback, to avoid ambiguity.Rename the
yapw.methods.blockingmodule to theyapw.methodsmodule.Merge the
PublisherandThreadedclasses into theBlockingclass.Merge the
DurableandTransientclasses into theBlockingclass, as adurablekeyword argument.
Non-breaking changes:
Pending futures are cancelled during graceful shutdown.
Use callbacks to communicate with the main thread from other threads, instead of sending SIGUSR1 or SIGUSR2 signals.
The signal handlers for the
Blockingclass are installed before the consumer starts, instead of during initialization.Don’t attempt to catch the
pika.exceptions.ConnectionClosedByBrokerexception in theyapw.clients.Blocking.consume()method (can’t be caught).Drop Python 3.7, 3.8, 3.9, 3.10 support.
0.0.13 (2022-01-28)¶
Fixed¶
Make thread management thread-safe in
yapw.clients.Threaded.
0.0.12 (2022-01-27)¶
Fixed¶
Eliminate a memory leak in
yapw.clients.Threaded.
0.0.11 (2022-01-27)¶
Added¶
yapw.clients.Publisher.declare_queueandyapw.clients.Threaded.consume()accept anargumentskeyword argument.
0.0.10 (2022-01-24)¶
Fixed¶
yapw.clients.Threaded.consume()cleans up threads and closes the connection (regression in 0.0.9).
0.0.9 (2022-01-24)¶
Fixed¶
yapw.clients.Threaded.consume()no longer attempts to close a closed connection.
0.0.8 (2022-01-19)¶
Added¶
yapw.decorators.decorate()passes the exception instance to theerrbackfunction via itsexceptionargument.
0.0.7 (2022-01-18)¶
Added¶
yapw.decorators.decorate()accepts afinalbackkeyword argument.
0.0.6 (2022-01-17)¶
Added¶
yapw.clients.Publisher.declare_queueandyapw.clients.Consumer.consume(): Rename therouting_keyargument toqueue, and add arouting_keysoptional argument.
Changed¶
Log a debug message when consuming each message.
0.0.5 (2021-11-22)¶
Added¶
yapw.clients.Threadedaccepts adecodekeyword argument.All
yapw.decoratorsfunctions pass decoded messages to consumer callbacks.
Changed¶
Add
decodeas first argument toyapw.decoratorsfunctions.yapw.clients.Publisher: Renameencoderkeyword argument toencode.yapw.clients.Publisher’sencodekeyword argument defaults toyapw.util.default_encode().yapw.util.default_encode()encodesstrtobytesand pickles non-strtobytes.
0.0.4 (2021-11-19)¶
Added¶
yapw.clients.Publisher(and children) acceptsencoderandcontent_typekeyword arguments.
Changed¶
Use the
SIGUSR1signal to kill the process from a thread.Add the channel number to the debug message for
publish().
0.0.3 (2021-11-19)¶
Added¶
Add and use
yapw.decorators.halt()as the default decorator.
Changed¶
Rename
yapw.decorators.rescue()todiscard().
0.0.2 (2021-11-19)¶
Added¶
Add
yapw.methods.publish()to publish messages from the context of a consumer callback.
Changed¶
Pass a
stateobject with aconnectionattribute to the consumer callback, instead of aconnectionobject. Mixins can set a__safe__class attribute to list attributes that can be used safely in the consumer callback. These attributes are added to thestateobject.Log debug messages when publishing, consuming and acknowledging messages.
0.0.1 (2021-11-19)¶
First release.