We could use special values to represent INFINITE and INSTANTANEOUS for the Dispatch.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 use match like this:
This came up again, as there seems to be easy to get confused by the different meaning of duration based on if it is 0 or None, so it might be a good idea to prioritize it @Marenz.
Activity
llucax commented on Oct 25, 2024
This came up again, as there seems to be easy to get confused by the different meaning of duration based on if it is 0 or None, so it might be a good idea to prioritize it @Marenz.