Comments (4)
Maybe I should have made this a discussion first. If anyone sees any controversy in this, we can convert it to a discussion. If there are no big objections, we can turn the TODO list into issues as we plan to address them.
from frequenz-channels-python.
I think many cases where users need to handle lots of tasks manually to cope with more dynamic situations, like the resampler, could be greatly simplified if they could be handled automatically by using a more flexible select.
I guess I'm just having trouble imagining what kind of possibilities would come out of these features. It sounds like they're to deal with scenarios where channels that we read from close for some reason. Is that accurate or are you thinking of other scenarios as well?
Is the resampler the only known use-case for these features? I'm not very familiar with it, so maybe that would be just a good first test: it would be nice to see how they would simplify the resampler. Would it help eliminate the two *helper layers?
So we just make a basic interface without implementation for the features proposed in this issue, then see how it affects the resampler, just to make sure we limit feature creep.
Or maybe even a simpler version if that sounds like too much work.
from frequenz-channels-python.
It sounds like they're to deal with scenarios where channels that we read from close for some reason.
Well, continuing with the resampling actor as an use case, at some point it is very likely that we'll need to be able to unsubscribe (when we'll be able to switch peak-shaving on and off for example). Maybe is going too much into the future, and we'll still somehow keep all subscriptions forever, but if we do need to unsubscribe, we'll need to close receivers.
Is that accurate or are you thinking of other scenarios as well?
I haven't think very hardly in particular scenarios, but is just more like the vague memory of use cases I saw in the past, but thinking again I think handling subscriptions is a good example. Another scenario for stopping a receiver might be stopping a timer, and maybe you want to re-enable later. But also this more dynamic scenario when we start to compose actors and might need to handle new messages/channels when an actor is created and remove it when it is gone.
Would it help eliminate the two *helper layers?
Yes, exactly. I think with this all that complexity should be gone.
So we just make a basic interface without implementation for the features proposed in this issue, then see how it affects the resampler, just to make sure we limit feature creep.
Or maybe even a simpler version if that sounds like too much work.
Yes, I don't think is something to implement right now, I put it in v0.17.0 just because there isn't much else after select()
is done (and thinking about how we could extend it with features that were in the air for a while). So I just had this idea, and thought it was pretty nice that select()
wouldn't even have to be touched, so I wanted to write it down.
I agree that it would be good to test the interface in the field before going for it.
from frequenz-channels-python.
Update after a new discussion we had around this:
- We'll remove
MergeNamed
(#236) and make a wrappermerge()
function forMerge
and makeMerge
private (#237), so updating the issue to reflect this. - We'll evaluate what's the best construction to implement dynamic/optional receivers for select separately. Note that we should still return a full
Receiver
somerge()
can also be used withselect()
.
from frequenz-channels-python.
Related Issues (20)
- `FileWatcher` should expose more `awatch` configuration options
- Write introductory documentation
- Many class attributes should be private or read-only
- Consolidate and make channels `name`s (`client_id` / `service_id`) optional
- Remove `Peekable`
- Remove `Bidirectional`
- Remove `MergeNamed`
- Expose `Merge` as a `merge()` function
- `Receiver.map()` doesn't preserve the original receiver's type HOT 8
- Backport timer `reset()` fix to v0.16 HOT 2
- `Timer`: Remove `periodic()` and `timeout()`
- Filewatcher is not reporting events in CIFS mounts HOT 3
- Documentation and code cleanup for 1.0 HOT 1
- Remove uses of `BaseException`
- Find a way to make using select less likely to starve a receiver HOT 1
- Channel that doesn't remove the oldest messages when receiver buffer is full HOT 2
- Implement `SyncSender` and `AsyncSender` HOT 5
- Add a periodic timer
- Refactor event type and initialization in FileWatcher
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frequenz-channels-python.