Changelog#
3.1.1 (unreleased)#
Requires eric-sse 3.0.1
The error handling contract runs with everything in Redis, as eric-sse 3.0.1 fixes laxertu/eric#53
3.1.0 (2026-11-25)#
BREAKING:
RedisStorage,RedisQueue,RedisQueueRepositoryandredis_channel_repository_buildertake aRedisConnection(host, port, db) instead of aredis.Redisclient, and default to a local Redis, database 0. Credentials and TLS are not supported. Storages and queues with equal connection data share one client, so one connection poolBREAKING:
RedisQueueRepositorystores queues pickled instead of their ids: queues persisted by 3.0.0 are not readable by 3.1.0RedisQueuecan be pickled: only its identity (connection data and queue id) is saved, messages stay in Rediswait_pop()runs BLPOP on an async client instead ofpop()in a worker thread: any number of streams can wait at once, each holding a Redis connection while waiting. A message popped by a cancelledwait_pop()is put back at the head of its queue
3.0.0 (2026-11-22)#
Requires eric-sse 3.0.0
BREAKING:
RedisConnectionRepository,RedisSSEChannelRepository,RedisListenerRepository,RedisQueuesRepositoryand the connection factories are replaced byredis_channel_repository_builder, that wires everything to Redis through eric-sse’sChannelRepositoryBuilderand can be further configured (listeners, error handlers) beforebuild()BREAKING:
BlockingRedisQueueandRedisSSEChannelBlockingQueuesRepositoryremoved, see Blocking queues belowBREAKING:
RedisConnectionremoved:RedisStorage,RedisQueue,RedisQueueRepositoryandredis_channel_repository_buildertake aredis.Redisclient, so connection details (credentials, TLS, pool, timeouts) are up to the application. The client must not decode responsesBREAKING: keys layout changed: data persisted by 2.x is not readable by 3.x
RedisStorageimplements eric-sse 3KvStorage: prefix searches match*,?,[,]literally and tolerate deletions while results are iteratedRedisQueueimplements eric-sse 3Queue:pop()returns immediately,pop(timeout)waits up to timeout seconds with BLPOP, without pollingAdded
RedisQueueRepository: it stores queue ids only, and gives loaded queues its client. Deleting a connection deletes its queued messages too, instead of leaving them in RedisAdded integration tests running eric-sse contracts (channel repository, queue, channel, error handling) against a real Redis
Blocking queues#
In 2.x, BlockingRedisQueue.pop() waited until a message was pushed, with no time limit.
Why it was dropped. eric-sse 3 requires every queue’s pop() to return immediately, raising
NoMessagesException when empty: waiting is now chosen by the caller, passing a timeout. eric-sse itself relies on
it, so a queue waiting forever on pop():
hangs
AbstractChannel.deliver_next()on an empty queue. Stopping the listener, removing the connection or deleting the channel can’t interrupt it, and it holds a Redis connection meanwhile. Called from async code, it freezes the event loop;breaks
DataProcessingChannel.process_queue(), that pops until the queue is empty: after the last message it blocks the event loop forever, and messages already popped are never yielded.
Same behaviour in 3.0.0. Use RedisQueue, and wait where you consume. Waits rely on BLPOP, so they
don’t poll, and a message pushed while waiting is returned at once.
In async code, wait for the next message without blocking the event loop:
connection.listener.start()
while True:
try:
msg = await channel.wait_next(connection.id, timeout=5)
except NoMessagesException:
continue # Nothing within 5 seconds: wait again, or check whether to stop
handle(msg)
or stream messages: message_stream starts the listener, waits for messages and ends when the listener stops:
async for event in channel.message_stream(connection.id):
...
In sync code, run the same wait, so that the listener and error handlers are notified as with deliver_next:
connection.listener.start()
while True:
try:
msg = asyncio.run(channel.wait_next(connection.id, timeout=5))
except NoMessagesException:
continue
handle(msg)
or pop from the queue directly, bypassing the channel (listener on_message and error handlers are not called):
msg = connection.queue.pop(timeout=5)
Timeouts replace “forever”: a consumer loop that waits again after each timeout behaves as the 2.x blocking queue, and still gets the chance to stop.
Repositories created with RedisSSEChannelBlockingQueuesRepository are created with
redis_channel_repository_builder(SSEChannel, redis_connection).build().