@@ -74,22 +74,45 @@ classDef edgeLabel line-height:2;
74
74
75
75
## 2. Sequence
76
76
77
+ Below is the sequence of events that occur when a developer registers a schedule and a callback function with Nitric.
78
+
79
+ ``` mermaid
80
+ sequenceDiagram
81
+ participant Worker as App Worker(s)
82
+ participant SDK as Nitric SDK
83
+ participant Nitric as Nitric CLI
84
+ participant Provider as Nitric Provider <br> (plugin)
85
+ participant IAC as IaC <br> (e.g. Terraform)
86
+
87
+ Worker->>SDK: Register Schedule
88
+ Worker->>SDK: Register Schedule Callback
89
+ SDK->>Nitric: Register Schedule
90
+
91
+ Nitric->>Provider: Forward Nitric Spec
92
+
93
+ opt Convert CRON
94
+ Provider->>Provider: Convert CRON / Rate Format
95
+ end
96
+
97
+ Provider->>IAC: Provision Schedule
98
+ Provider->>IAC: Provision IAM
99
+ ```
100
+
101
+ ### Runtime Sequence
102
+
103
+ Below is the runtime flow of a schedule service triggering a Nitric service and executing the application logic in the schedule callback.
104
+
77
105
``` mermaid
78
106
sequenceDiagram
79
- participant Developer as Developer
80
- participant NitricSDK as Nitric SDK
81
- participant NitricRuntime as Nitric Runtime
82
- participant Scheduler as Cloud Scheduler
83
- participant Worker as Application Worker
84
-
85
- Developer->>NitricSDK: Define schedule (e.g., CRON job)
86
- NitricSDK->>NitricRuntime: Deploy schedule configuration
87
- NitricRuntime->>Scheduler: Create schedule in cloud scheduler
88
-
89
- Scheduler->>NitricRuntime: Trigger scheduled task (e.g., CRON event)
90
- NitricRuntime->>Worker: Forward scheduled event with payload
91
- Worker-->>NitricRuntime: Process task and return result
92
- NitricRuntime-->>Scheduler: Confirm execution (success or error)
107
+ participant CloudAPI as Cloud Schedule <br> (e.g. CloudWatch)
108
+ participant Nitric as Nitric Runtime <br> (plugin)
109
+ participant SDK as Nitric SDK
110
+ participant Client as App Code
111
+
112
+ CloudAPI->>Nitric: Scheduled Event
113
+ Nitric->>Nitric: Convert Format
114
+ Nitric->>SDK: Forward Event
115
+ SDK->>Client: Execute Callback
93
116
```
94
117
95
118
## 3. Component
0 commit comments