You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main change in this release is the revamp of exception handling in general. New exceptions were created and send() now raises an exception too when it fails.
Hopefully they are now used much more uniformly across the whole library.
Upgrading
The Sender.send() method now raises a SenderError instead of returning False. The SenderError will typically have a ChannelClosedError and the underlying reason as a chained exception.
The Receiver.ready() method (and related receive() and __anext__ when used as an async iterator) now raises a ReceiverError and in particular a ReceiverStoppedError when the receiver has no more messages to receive.
Receiver.consume() doesn't raise any exceptions.
Receivers raising EOFError now raise ReceiverInvalidatedError instead.
For channels which senders raise an error when the channel is closed or which receivers stop receiving when the channel is closed, the SenderError and ReceiverStoppedError are chained with a __cause__ that is a ChannelClosedError with the channel that was closed.
ChannelClosedError now requires the argument channel (before it was optional).
Now exceptions are not raised in Receiver.ready() but in Receiver.consume() (receive() or the async iterator anext).
New Features
New exceptions were added:
Error: A base exception from which all exceptions from this library inherit.
SendError: Raised for errors when sending messages.
ReceiverError: Raised for errors when receiving messages.
ReceiverClosedError: Raised when a receiver don't have more messages to receive.
ReceiverInvalidatedError: Raised when a receiver was invalidated (for example it was converted into a Peekable).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Frequenz Channels Release Notes
Summary
The main change in this release is the revamp of exception handling in general. New exceptions were created and
send()
now raises an exception too when it fails.Hopefully they are now used much more uniformly across the whole library.
Upgrading
The
Sender.send()
method nowraise
s aSenderError
instead of returningFalse
. TheSenderError
will typically have aChannelClosedError
and the underlying reason as a chained exception.The
Receiver.ready()
method (and relatedreceive()
and__anext__
when used as an async iterator) nowraise
s aReceiverError
and in particular aReceiverStoppedError
when the receiver has no more messages to receive.Receiver.consume()
doesn't raise any exceptions.Receivers raising
EOFError
now raiseReceiverInvalidatedError
instead.For channels which senders raise an error when the channel is closed or which receivers stop receiving when the channel is closed, the
SenderError
andReceiverStoppedError
are chained with a__cause__
that is aChannelClosedError
with the channel that was closed.ChannelClosedError
now requires the argumentchannel
(before it was optional).Now exceptions are not raised in Receiver.ready() but in Receiver.consume() (receive() or the async iterator
anext
).New Features
New exceptions were added:
Error
: A base exception from which all exceptions from this library inherit.SendError
: Raised for errors when sending messages.ReceiverError
: Raised for errors when receiving messages.ReceiverClosedError
: Raised when a receiver don't have more messages to receive.ReceiverInvalidatedError
: Raised when a receiver was invalidated (for example it was converted into aPeekable
).What's Changed
New Contributors
Full Changelog: v0.13.0...v0.14.0
This discussion was created from the release v0.14.0.
Beta Was this translation helpful? Give feedback.
All reactions