commandnet 0.4.0__tar.gz → 0.4.2__tar.gz
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.
- {commandnet-0.4.0 → commandnet-0.4.2}/PKG-INFO +1 -1
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/core/models.py +1 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/engine/runtime.py +6 -1
- {commandnet-0.4.0 → commandnet-0.4.2}/pyproject.toml +1 -1
- {commandnet-0.4.0 → commandnet-0.4.2}/README.md +0 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/__init__.py +0 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/core/graph.py +0 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/core/node.py +0 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/interfaces/event_bus.py +0 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/interfaces/observer.py +0 -0
- {commandnet-0.4.0 → commandnet-0.4.2}/commandnet/interfaces/persistence.py +0 -0
|
@@ -11,6 +11,7 @@ class Event(BaseModel):
|
|
|
11
11
|
subject_id: str
|
|
12
12
|
node_name: str
|
|
13
13
|
payload: Optional[Dict[str, Any]] = None
|
|
14
|
+
headers: Dict[str, str] = Field(default_factory=dict)
|
|
14
15
|
|
|
15
16
|
timestamp: str = Field(default_factory=utcnow_iso)
|
|
16
17
|
run_at: str = Field(default_factory=utcnow_iso)
|
|
@@ -127,6 +127,9 @@ class Engine:
|
|
|
127
127
|
duration: float = 0.0,
|
|
128
128
|
payload: Any = None,
|
|
129
129
|
):
|
|
130
|
+
headers = {}
|
|
131
|
+
if hasattr(context, "trace_headers") and context.trace_headers:
|
|
132
|
+
headers = context.trace_headers
|
|
130
133
|
# 1. Interrupt (Cancellation)
|
|
131
134
|
if isinstance(target, Interrupt):
|
|
132
135
|
await self.cancel_subject(target.subject_id, target.hard)
|
|
@@ -192,7 +195,8 @@ class Engine:
|
|
|
192
195
|
await self.observer.on_transition(subject_id, "RUN", node_name, duration)
|
|
193
196
|
|
|
194
197
|
p_load = payload.model_dump() if hasattr(payload, "model_dump") else payload
|
|
195
|
-
|
|
198
|
+
|
|
199
|
+
evt = Event(subject_id=subject_id, node_name=node_name, payload=p_load, headers=headers)
|
|
196
200
|
ctx_dict = self._dump_ctx(context)
|
|
197
201
|
|
|
198
202
|
if "#" in subject_id:
|
|
@@ -292,6 +296,7 @@ class Engine:
|
|
|
292
296
|
payload=p_load,
|
|
293
297
|
run_at=run_at_dt.isoformat(),
|
|
294
298
|
idempotency_key=target.idempotency_key,
|
|
299
|
+
headers=headers,
|
|
295
300
|
)
|
|
296
301
|
|
|
297
302
|
await self.db.schedule_event(scheduled_evt)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "commandnet"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.2"
|
|
4
4
|
description = "A lightweight, Pydantic-powered, distributed event-driven state machine and typed node graph runtime."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Christopher Vaz", email = "christophervaz160@gmail.com" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|