Skip to content

Commit e7c37b7

Browse files
authored
Clear release notes (#120)
2 parents ecaca06 + 793cbd8 commit e7c37b7

File tree

1 file changed

+6
-59
lines changed

1 file changed

+6
-59
lines changed

RELEASE_NOTES.md

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,16 @@
22

33
## Summary
44

5-
This release introduces a more flexible and powerful mechanism for managing dispatch events with new strategies for merging intervals, enhanced customization options, and better overall alignment with evolving SDK dependencies. It also simplifies actor initialization while maintaining robust support for diverse dispatch scenarios.
5+
<!-- Here goes a general summary of what this release is about -->
66

77
## Upgrading
88

9-
A new simplified way to manage actors has been introduced:
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1010

11-
Change your code from:
12-
```python
13-
dispatcher = Dispatcher(
14-
microgrid_id=microgrid_id,
15-
server_url=url,
16-
key=key
17-
)
18-
dispatcher.start()
19-
20-
status_receiver = dispatcher.new_running_state_event_receiver("EXAMPLE_TYPE")
21-
22-
managing_actor = ActorDispatcher(
23-
actor_factory=MyActor.new_with_dispatch,
24-
running_status_receiver=status_receiver,
25-
)
26-
27-
await run(managing_actor)
28-
```
29-
30-
to
31-
32-
```python
33-
async with Dispatcher(
34-
microgrid_id=microgrid_id,
35-
server_url=url,
36-
key=key
37-
) as dispatcher:
38-
await dispatcher.start_managing(
39-
dispatch_type="EXAMPLE_TYPE",
40-
actor_factory=MyActor.new_with_dispatch, # now async factory!
41-
merge_strategy=MergeByType,
42-
)
43-
await dispatcher
44-
```
45-
46-
Further changes:
47-
48-
* `Dispatcher.start` is no longer `async`. Remove `await` when calling it.
49-
* Two properties have been replaced by methods that require a type as parameter.
50-
* `Dispatcher.lifecycle_events` has been replaced by the method `Dispatcher.new_lifecycle_events_receiver(self, dispatch_type: str)`.
51-
* `Dispatcher.running_status_change` has been replaced by the method `Dispatcher.new_running_state_event_receiver(self, dispatch_type: str, merge_strategy: MergeStrategy)`.
52-
* The managing actor constructor no longer requires the `dispatch_type` parameter. Instead you're expected to pass the type to the new_receiver function.
53-
* The `DispatchManagingActor` class has been renamed to `DispatchActorsService`.
54-
* It's interface has been simplified and now only requires an actor factory and a running status receiver.
55-
* It only starts/stops a single actor at a time now instead of a set of actors.
56-
* Refer to the updated [usage example](https://frequenz-floss.github.io/frequenz-dispatch-python/latest/reference/frequenz/dispatch/#frequenz.dispatch.DispatchActorsService) for more information.
57-
* `DispatchUpdate` was renamed to `DispatchInfo`.
11+
## New Features
5812

13+
<!-- Here goes the main new features and examples or instructions on how to use them -->
5914

60-
## New Features
15+
## Bug Fixes
6116

62-
* A new feature "merge strategy" (`MergeByType`, `MergeByTypeTarget`) has been added to the `Dispatcher.new_running_state_event_receiver` method. Using it, you can automatically merge consecutive and overlapping dispatch start/stop events of the same type. E.g. dispatch `A` starting at 10:10 and ending at 10:30 and dispatch `B` starts at 10:30 until 11:00, with the feature enabled this would in total trigger one start event, one reconfigure event at 10:30 and one stop event at 11:00.
63-
* The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1800.
64-
* Actor management with dispatches has been simplified:
65-
* `Dispatcher.start_managing(dispatch_type, actor_factory, merge_strategy, retry_interval)` to manage your actor for the given type and merge strategy. All you need provide is an actor factory.
66-
* `Dispatcher.stop_managing(dispatch_type)` to stop dispatching for the given type.
67-
* `Dispatcher.is_managed(dispatch_type)` to check if dispatching is active for the given type.
68-
* Dispatches that failed to start will now be retried after a delay.
69-
* A new method `Dispatcher.wait_for_initialization()` has been added to wait for all actors to be initialized.
70-
* When using `async with Dispatcher(..) as dispatcher`, the dispatcher will first wait for the dispatch service to be initialized before entering the block.
17+
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->

0 commit comments

Comments
 (0)