-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rewrite interface #28
Comments
Some other ideas, after a long discussion. If we make the For example, for the power setting actor, since it works with component pools, it would make sense to merge dispatches with the same selector, which will map with one component pool. In this case:
We would normally receive these events:
But it would make more sense to receive this (
The code could look like this: async for dispatch_event in merge_same_selector(dispatcher.running_status_change.new_receiver()):
match dispatch_event:
Start(dispatch):
actor = PowerSettingActor(dispatch)
actor.start()
self._actors[dispatch.selector] = actor
Stop(dispatch):
if actor := self._actors.get(dispatch.selector):
await actor.stop()
Update(dispatch):
if actor := self._actors.get(dispatch.selector):
await actor.reconfigure(dispatch) Where Another example, for FCR, we want to override any overlapping dispatches:
We would normally receive these events:
But it would make more sense to receive this (
The code will basically look the same but applying a different filter: async for dispatch_event in merg_overlapping(dispatcher.running_status_change.new_receiver()):
match dispatch_event:
... |
To be able to do this, maybe we need to update the |
Instead of having
after all, the |
I think you care about the dispatch contents, at least the payload. If you get a |
I suppose they could be sorted by latest update_time and there could be a
|
Why latest update time? If you have one dispatch id=2 from 10 to 11, and dispatch id=3 from 11 to 12, and it is 10:30 and someone updates dispatch id=3, then the returned dispatch should be id=2 even when the last updated dispatch is id=3, right? I think you would need to search which dispatch is currently active based on the current time, no? |
i'd say there would be no event at all in your example because it wouldn't change the current running state? Only at 11 it would trigger an event containing only id 3? |
Yeah, if the payload changed, a "reconfigure"/"update" event should be sent so the actor can act on it. |
Yeah, that's what I was thinking of. To put more context to the example, lets say disaptch id=2 says charge 5kw and id=3 says charge 1kw. The actor should switch from 5kw to 1 kw at 11, right? |
That sounds about right,, also, github copilot wants to say that:
|
What's needed?
See #22 (comment) for details
Proposed solution
No response
Use cases
No response
Alternatives and workarounds
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: