Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 6cf6fc6

Browse files
jyecuschdavemooreuws
authored andcommitted
update schedule sequences
1 parent ed50b16 commit 6cf6fc6

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

docs/architecture/schedules.mdx

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,45 @@ classDef edgeLabel line-height:2;
7474

7575
## 2. Sequence
7676

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+
77105
```mermaid
78106
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
93116
```
94117

95118
## 3. Component

docs/architecture/topics.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ sequenceDiagram
112112
Provider->>IAC: Provision Event Rule(s)
113113
Provider->>IAC: Provision IAM
114114
end
115+
116+
opt Delayed Messaging
117+
Provider->>IAC: Provision Delayed Messaging
118+
end
115119
```
116120

117121
### Runtime Sequence
@@ -129,7 +133,7 @@ sequenceDiagram
129133
Client->>SDK: Publish(message)
130134
SDK->>Nitric: Forward Request
131135
Nitric->>Nitric: Convert Request
132-
Nitric->>CloudAPI: Topic API Request
136+
Nitric->>CloudAPI: Send Message to Topic
133137
else Subscriber
134138
CloudAPI->>Nitric: Message
135139
Nitric->>Nitric: Convert Message

0 commit comments

Comments
 (0)