You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- **Add method to check if a type is currently being dispatched**
- **Make actor_factory function async for more flexibility**
- **Add parameter `autostart` to `Dispatcher()` service**
- **Add retry delay and auto restart to ActorService**
- **Update Docs, Readme, Release Notes**
actor_factory=MyActor.new_with_dispatch, # now async factory!
41
+
merge_strategy=MergeByType,
42
+
)
43
+
await dispatcher
44
+
```
45
+
46
+
Further changes:
47
+
9
48
*`Dispatcher.start` is no longer `async`. Remove `await` when calling it.
10
49
* Two properties have been replaced by methods that require a type as parameter.
11
50
*`Dispatcher.lifecycle_events` has been replaced by the method `Dispatcher.new_lifecycle_events_receiver(self, dispatch_type: str)`.
12
51
*`Dispatcher.running_status_change` has been replaced by the method `Dispatcher.new_running_state_event_receiver(self, dispatch_type: str, merge_strategy: MergeStrategy)`.
13
-
* The managing actor constructor no longer requires the `dispatch_type` parameter. Instead you're expected to pass the type to the new-receiver function.
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.
14
53
* The `DispatchManagingActor` class has been renamed to `DispatchActorsService`.
15
54
* It's interface has been simplified and now only requires an actor factory and a running status receiver.
16
55
* It only starts/stops a single actor at a time now instead of a set of actors.
@@ -22,4 +61,10 @@ This release introduces a more flexible and powerful mechanism for managing disp
22
61
23
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.
24
63
* The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1800.
25
-
* Actor management with dispatches has been simplified. Calling `Dispatcher.start_dispatching(dispatch_type, actor_factory, merge_strategy)` will begin managing your actor for the given type and merge strategy. All you need provide is an actor factory. To stop dispatching for your type, call `Dispatcher.stop_dispatching(dispatch_type)`.
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.
0 commit comments