Consider adding a Duration
enum with INFINITE
and INSTANTANEOUS
#93
Labels
part:client
Affects the client code
part:dispatcher
scope:breaking-change
Breaking change, users will need to update their code
type:enhancement
New feature or enhancement visitble to users
We could use special values to represent
INFINITE
andINSTANTANEOUS
for theDispatch.duration
field, so the code gets more readable (without the need for comments) and more type-safe.We could set the type of
duration: timedelta | Duration
where duration is a enum for example, then we can also usematch
like this:Taking it even a bit further, we could have a
PositiveTimedelta
object that even guarantee the time is positive.Originally posted by @llucax in frequenz-floss/frequenz-dispatch-python#54 (comment)
The text was updated successfully, but these errors were encountered: