FlowerPower 1.0.0b1__py3-none-any.whl → 1.0.0b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flowerpower/__init__.py +2 -3
- flowerpower/cfg/__init__.py +10 -8
- flowerpower/cfg/pipeline/__init__.py +11 -7
- flowerpower/cfg/project/__init__.py +11 -8
- flowerpower/cfg/project/job_queue.py +10 -29
- flowerpower/cli/__init__.py +62 -28
- flowerpower/cli/job_queue.py +306 -123
- flowerpower/cli/mqtt.py +22 -16
- flowerpower/cli/pipeline.py +294 -114
- flowerpower/flowerpower.py +14 -8
- flowerpower/fs/__init__.py +7 -3
- flowerpower/fs/ext.py +6 -2
- flowerpower/io/base.py +17 -10
- flowerpower/io/loader/_duckdb.py +1 -0
- flowerpower/io/loader/deltatable.py +6 -2
- flowerpower/io/saver/deltatable.py +1 -2
- flowerpower/job_queue/__init__.py +16 -12
- flowerpower/job_queue/apscheduler/__init__.py +1 -1
- flowerpower/job_queue/apscheduler/manager.py +11 -6
- flowerpower/job_queue/apscheduler/utils.py +6 -4
- flowerpower/job_queue/base.py +1 -0
- flowerpower/job_queue/rq/__init__.py +1 -1
- flowerpower/job_queue/rq/manager.py +12 -3
- flowerpower/pipeline/io.py +11 -9
- flowerpower/pipeline/job_queue.py +5 -5
- flowerpower/pipeline/manager.py +35 -27
- flowerpower/pipeline/registry.py +26 -16
- flowerpower/pipeline/runner.py +3 -4
- flowerpower/plugins/mqtt/__init__.py +7 -7
- flowerpower/plugins/mqtt/cfg.py +3 -2
- flowerpower/plugins/mqtt/manager.py +25 -23
- flowerpower/utils/misc.py +6 -4
- flowerpower/utils/templates.py +1 -4
- {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/METADATA +1 -1
- {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/RECORD +38 -38
- {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/WHEEL +0 -0
- {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/entry_points.txt +0 -0
- {flowerpower-1.0.0b1.dist-info → flowerpower-1.0.0b3.dist-info}/top_level.txt +0 -0
flowerpower/cli/mqtt.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
import typer
|
2
|
-
import sys
|
3
|
-
from ..plugins.mqtt import (
|
4
|
-
start_listener as start_listener_,
|
5
|
-
run_pipeline_on_message as run_pipeline_on_message_,
|
6
|
-
)
|
7
|
-
from .utils import parse_dict_or_list_param, load_hook
|
8
1
|
import importlib
|
2
|
+
import sys
|
3
|
+
|
4
|
+
import typer
|
5
|
+
|
6
|
+
from ..plugins.mqtt import run_pipeline_on_message as run_pipeline_on_message_
|
7
|
+
from ..plugins.mqtt import start_listener as start_listener_
|
8
|
+
from .utils import load_hook, parse_dict_or_list_param
|
9
|
+
|
9
10
|
app = typer.Typer(help="MQTT management commands")
|
10
11
|
|
11
12
|
|
@@ -78,13 +79,19 @@ def run_pipeline_on_message(
|
|
78
79
|
client_id: str | None = None,
|
79
80
|
client_id_suffix: str | None = None,
|
80
81
|
config_hook: str | None = None,
|
81
|
-
max_retries: int = typer.Option(
|
82
|
-
|
83
|
-
|
82
|
+
max_retries: int = typer.Option(
|
83
|
+
3, help="Maximum number of retry attempts if pipeline execution fails"
|
84
|
+
),
|
85
|
+
retry_delay: float = typer.Option(
|
86
|
+
1.0, help="Base delay between retries in seconds"
|
87
|
+
),
|
88
|
+
jitter_factor: float = typer.Option(
|
89
|
+
0.1, help="Random factor (0-1) applied to delay for jitter"
|
90
|
+
),
|
84
91
|
):
|
85
92
|
"""Run a pipeline on a message
|
86
93
|
|
87
|
-
This command sets up an MQTT listener that executes a pipeline whenever a message is
|
94
|
+
This command sets up an MQTT listener that executes a pipeline whenever a message is
|
88
95
|
received on the specified topic. The pipeline can be configured to retry on failure
|
89
96
|
using exponential backoff with jitter for better resilience.
|
90
97
|
|
@@ -117,13 +124,13 @@ def run_pipeline_on_message(
|
|
117
124
|
Examples:
|
118
125
|
# Basic usage with a specific topic
|
119
126
|
$ flowerpower mqtt run-pipeline-on-message my_pipeline --topic sensors/data
|
120
|
-
|
127
|
+
|
121
128
|
# Configure retries for resilience
|
122
129
|
$ flowerpower mqtt run-pipeline-on-message my_pipeline --topic sensors/data --max-retries 5 --retry-delay 2.0
|
123
|
-
|
130
|
+
|
124
131
|
# Run as a job with custom MQTT settings
|
125
132
|
$ flowerpower mqtt run-pipeline-on-message my_pipeline --topic events/process --as-job --qos 2 --host mqtt.example.com
|
126
|
-
|
133
|
+
|
127
134
|
# Use a config hook to process messages
|
128
135
|
$ flowerpower mqtt run-pipeline-on-message my_pipeline --topic data/incoming --config-hook process_message
|
129
136
|
|
@@ -136,10 +143,9 @@ def run_pipeline_on_message(
|
|
136
143
|
parsed_storage_options = parse_dict_or_list_param(storage_options, "dict")
|
137
144
|
|
138
145
|
config_hook_function = None
|
139
|
-
if config_hook:
|
146
|
+
if config_hook:
|
140
147
|
config_hook_function = load_hook(name, config_hook, base_dir, storage_options)
|
141
148
|
|
142
|
-
|
143
149
|
run_pipeline_on_message_(
|
144
150
|
name=name,
|
145
151
|
topic=topic,
|