core pulse action for triggering scheduled pulse ability on subscribing actions.
This action provides a core mechanism for triggering scheduled pulse activities in subscribing actions. As a pulse action, it ensures periodic and timely execution of tasks within the subscribing actions framework. The package is a singleton and requires the Jivas library version 2.0.0.
jivas/pulse_action
PulseAction
^2.0.0
Below is detailed guidance on how to configure and use the Pulse Action.
The Pulse Action provides a mechanism for scheduling and triggering periodic tasks. It supports configurations for various use cases, including:
The action accepts direct entries under the config
parameter, which can be specified in the agent descriptor entry for the action. Below is an example:
- action: jivas/pulse_action
context:
enabled: true
version: ">=0.0.1"
config:
DHBReportUpdateInteractAction: every().day.at("05:30", "America/Guyana")
config
ParameterThe config
parameter accepts key-value mappings where the key is the action label, and the value is the scheduling specification. The scheduling syntax follows the conventions outlined in the schedule library documentation.
config = {
# Example key-value mappings
"PulseAction": "every(5).seconds",
"XYZAction": "every(1).hour.until('2030-01-01 18:00')"
}
Once a reference to the pulse_action
is acquired, you can programmatically add or remove schedule entries using the following methods:
pulse_action = self.get_agent().get_actions().get(action_label="PulseAction")
pulse_action.add_schedule("MyOwnAction", "every(1).hour.until('2030-01-01 18:00')")
pulse_action.remove_schedule("MyOwnAction")
add_schedule(action_label: str, interval_spec: str)
Adds a new schedule entry for the specified action and interval.
Example:
pulse_action.add_schedule("MyOwnAction", "every(1).hour.until('2030-01-01 18:00')")
remove_schedule(action_label: str)
Removes an existing schedule entry for the specified action.
Example:
pulse_action.remove_schedule("MyOwnAction")
These methods allow dynamic management of schedules, enabling flexibility and scalability for task execution.
pulse_action
project.git clone https://github.com/TrueSelph/pulse_action
git checkout -b new-feature-x
git commit -m 'Implemented new feature x.'
git push origin new-feature-x
This project is protected under the Apache License 2.0. See LICENSE for more information.
jvcli download action jivas/pulse_action
Last published
a month ago
Version
0.0.2
Downloads
195
Author
jivasType
action
Visibility
Public
Tags