-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp modules structure #235
Commits on Nov 7, 2023
-
Having bidirectional channels is not a recommended practice, as it could introduce deadlocks. It is a very niche use case, so it is better to remove it. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for db1a80d - Browse repository at this point
Copy the full SHA db1a80dView commit details -
Remove
Peekable
and associated methods/classes`Peekable` was a class that allowed users to peek at the latest value in a channel, without consuming anything. Even when useful in principle, it is a special case that breaks the whole channel abstraction, and can easily be emulated by just using a normal receiver and caching the last value. Also the following symbols are removed as they are not longer used: * 'Broadcast.new_peekable` * `Receiver.into_peekable` * `ReceiverInvalidatedError` Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for 6f73235 - Browse repository at this point
Copy the full SHA 6f73235View commit details -
Don't import
TypeVar
s from other modulesThere is little gain in importing type variables from other modules, as it adds unncecessary dependencies between modules. Type variables are just an artifact to define stuff locally. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for e1358ec - Browse repository at this point
Copy the full SHA e1358ecView commit details -
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for cb68d99 - Browse repository at this point
Copy the full SHA cb68d99View commit details -
Split
_base_classes
into_receiver
and_sender
Also move the receiver exceptions from `_exceptions` to `_receiver` and the sender exceptions from `_exceptions` to `_sender`. This avoids circular imports. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for f7c86cc - Browse repository at this point
Copy the full SHA f7c86ccView commit details -
Make channels return the base sender and receiver types
We don't really want end users to have access to the concrete types, and their custom methods. We want them to use the base types, so we can change the implementation without breaking their code and ensuring a common interface for all senders and receivers. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for 805b70f - Browse repository at this point
Copy the full SHA 805b70fView commit details -
Make channel's sender and receiver implementation private
We don't want to expose the implementation of the sender and receiver at all, so we make them private to the module. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for 1708cb2 - Browse repository at this point
Copy the full SHA 1708cb2View commit details -
Don't use aliases for the base sender and receiver classes
Now that the sender and receiver implementations are private, there is no need to use aliases for the base classes. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for b17803d - Browse repository at this point
Copy the full SHA b17803dView commit details -
Move merge and select symbols to the top level
These are core component to work with channels, so they are moved to the `frequenz.channels` top level module. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for c3951f7 - Browse repository at this point
Copy the full SHA c3951f7View commit details -
Move utility receivers to their own public modules
We move the `Event`, `FileWatcher` and `Timer` receivers to their own separate public modules. Since they are not core components and users might only need to use some of them, it is more clear to have them separated. Also in the case of the `FileWatcher`, it requires an extra dependency, which we could potentially have as an optional dependency, so users that don't need it don't need to install it. In the future we might distribute these also as separate python packages (wheels). Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for 25b38ba - Browse repository at this point
Copy the full SHA 25b38baView commit details -
Move nested class out of the parent class
Removing nested classes avoids having to use hacky constructions, like requiring the use of `from __future__ import annotations`, types as strings and confusing the `mkdocstrings` tools when extracting and cross-linking docs. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for dd756d7 - Browse repository at this point
Copy the full SHA dd756d7View commit details
Commits on Nov 8, 2023
-
This is from the beta-2 release, so we clear it out until we are ready for the new release. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for 8e70c41 - Browse repository at this point
Copy the full SHA 8e70c41View commit details -
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Configuration menu - View commit details
-
Copy full SHA for cc17298 - Browse repository at this point
Copy the full SHA cc17298View commit details