v0.14.0
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 nowraises aSenderErrorinstead of returningFalse. TheSenderErrorwill typically have aChannelClosedErrorand the underlying reason as a chained exception. -
The
Receiver.ready()method (and relatedreceive()and__anext__when used as an async iterator) nowraises aReceiverErrorand in particular aReceiverStoppedErrorwhen the receiver has no more messages to receive.Receiver.consume()doesn't raise any exceptions.Receivers raising
EOFErrornow raiseReceiverInvalidatedErrorinstead. -
For channels which senders raise an error when the channel is closed or which receivers stop receiving when the channel is closed, the
SenderErrorandReceiverStoppedErrorare chained with a__cause__that is aChannelClosedErrorwith the channel that was closed. -
ChannelClosedErrornow 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
- Clean release notes by @ela-kotulska-frequenz in #69
- Fix build badge by @leandro-lucarella-frequenz in #71
- Improve and add exceptions by @leandro-lucarella-frequenz in #61
- Make assert msg grammatically correct and less ambiguous by @mathias-baumann-frequenz in #74
- Finish release notes for v0.14.0 by @leandro-lucarella-frequenz in #80
New Contributors
- @mathias-baumann-frequenz made their first contribution in #74
Full Changelog: v0.13.0...v0.14.0