Skip to content

Tags: frequenz-floss/frequenz-dispatch-python

Tags

v0.6.1

Toggle v0.6.1's commit message

Verified

This tag was signed with the committer’s verified signature.
shsms Sahas Subramanian
# Dispatch Highlevel Interface Release Notes

## Upgrading

- Some minimal dependencies were updated, you might need to adjust your project's dependencies too.

## New Features

- `DispatchInfo._src` was added for rare complex scenarios where the source of a dispatch needs to be accessed.

v0.6.0

Toggle v0.6.0's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

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.

## Upgrading

A new simplified way to manage actors has been introduced:

Change your code from:
```python
dispatcher = Dispatcher(
    microgrid_id=microgrid_id,
    server_url=url,
    key=key
)
dispatcher.start()

status_receiver = dispatcher.new_running_state_event_receiver("EXAMPLE_TYPE")

managing_actor = ActorDispatcher(
    actor_factory=MyActor.new_with_dispatch,
    running_status_receiver=status_receiver,
)

await run(managing_actor)
```

to

```python
async with Dispatcher(
    microgrid_id=microgrid_id,
    server_url=url,
    key=key
) as dispatcher:
    await dispatcher.start_managing(
        dispatch_type="EXAMPLE_TYPE",
        actor_factory=MyActor.new_with_dispatch, # now async factory!
        merge_strategy=MergeByType,
    )
    await dispatcher
```

Further changes:

* `Dispatcher.start` is no longer `async`. Remove `await` when calling it.
* Two properties have been replaced by methods that require a type as parameter.
    * `Dispatcher.lifecycle_events` has been replaced by the method `Dispatcher.new_lifecycle_events_receiver(self, dispatch_type: str)`.
    * `Dispatcher.running_status_change` has been replaced by the method `Dispatcher.new_running_state_event_receiver(self, dispatch_type: str, merge_strategy: MergeStrategy)`.
* The managing actor constructor no longer requires the `dispatch_type` parameter. Instead you're expected to pass the type to the new_receiver function.
* The `DispatchManagingActor` class has been renamed to `DispatchActorsService`.
    * It's interface has been simplified and now only requires an actor factory and a running status receiver.
    * It only starts/stops a single actor at a time now instead of a set of actors.
    * Refer to the updated [usage example](https://frequenz-floss.github.io/frequenz-dispatch-python/latest/reference/frequenz/dispatch/#frequenz.dispatch.DispatchActorsService) for more information.
* `DispatchUpdate` was renamed to `DispatchInfo`.

## New Features

* 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.
* The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1800.
* Actor management with dispatches has been simplified:
    * `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.
    * `Dispatcher.stop_managing(dispatch_type)` to stop dispatching for the given type.
    * `Dispatcher.is_managed(dispatch_type)` to check if dispatching is active for the given type.
    * Dispatches that failed to start will now be retried after a delay.
* A new method `Dispatcher.wait_for_initialization()` has been added to wait for all actors to be initialized.
* When using `async with Dispatcher(..) as dispatcher`, the dispatcher will first wait for the dispatch service to be initialized before entering the block.

v0.5.1

Toggle v0.5.1's commit message

Verified

This tag was signed with the committer’s verified signature.
llucax Leandro Lucarella
# Dispatch Highlevel Interface Release Notes

## Summary

* The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1600

v0.5.0

Toggle v0.5.0's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

## Upgrading

* The method `Dispatch.running(type: str)` was replaced with the property `Dispatch.started: bool`.
* The SDK dependency was widened to allow versions up to (excluding) v1.0.0-rc1500

## New Features

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

## Bug Fixes

* Fixed a crash when reading a Dispatch with frequency YEARLY.

v0.4.0

Toggle v0.4.0's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

* Updates lots of dependencies and through those gets a few new features:
 * `start_immediately` when creating dispatches is now supported.
 * `http2 keepalive` is now supported and enabled by default.
 * Some bugfixes from the channels & sdk libraries. are now included.

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->

## New Features

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

## Bug Fixes

* Fixed a crash in the `DispatchManagingActor` when dispatches shared an equal start time.

v0.3.4

Toggle v0.3.4's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

This is a hot fix for recurrence not working when even one `by-*` field isn't explicitly set.

v0.3.3

Toggle v0.3.3's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

* `frequenz-sdk` dependency has been extended to include version `1.0.0-rc1000`.

v0.3.2

Toggle v0.3.2's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

* This fixes a crash when the `YEARLY` frequency is used in a dispatch.

v0.3.1

Toggle v0.3.1's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

<!-- Here goes a general summary of what this release is about -->

## Upgrading

* `Dispatcher.running_state_change` now also sends a message when the duration specified in the dispatch has passed. If no duration is specified, no STOPPED message will be sent.

## New Features

* We now provide the `DispatchManagingActor` class, a class to manage actors based on incoming dispatches.

## Bug Fixes

<!-- Here goes notable bug fixes that are worth a special mention or explanation -->

v0.3.0

Toggle v0.3.0's commit message

Verified

This tag was signed with the committer’s verified signature.
Marenz Mathias L. Baumann
# Dispatch Highlevel Interface Release Notes

## Summary

<!-- Here goes a general summary of what this release is about -->

## Upgrading

- The dispatch high level interface now depends on `frequenz-sdk` version `v1.0.0-rc900`.
- We are now using the version `0.6.0` of the underlying `frequenz-client-dispatch` client library.
- The init parameter of the `Dispatcher` class has been changed to accept a `server_url` instead.

## New Features

* Using the new dispatch client, we now have support for pagination in the dispatch list request.
* The new client version also supports streaming, however it is not yet used internally in the high level interface.

## Bug Fixes

- Fix documentation cross-linking to the `frequenz-client-dispatch` package.