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

Commit 265ad59

Browse files
jyecuschdavemooreuws
authored andcommitted
update async messaging sequences
1 parent 66cab4d commit 265ad59

File tree

5 files changed

+99
-51
lines changed

5 files changed

+99
-51
lines changed

docs/architecture/apis.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ sequenceDiagram
9595
participant Worker as App Worker(s)
9696
participant SDK as Nitric SDK
9797
participant Nitric as Nitric CLI
98-
participant Provider as Nitric Provider
99-
participant IAC as IaC
98+
participant Provider as Nitric Provider <br> (plugin)
99+
participant IAC as IaC <br> (e.g. Terraform)
100100
101101
Worker->>SDK: Register API(s)
102102
SDK->>Nitric: Register API(s)
@@ -122,9 +122,9 @@ Here is the sequence of events that occur at runtime when a client makes an HTTP
122122
```mermaid
123123
sequenceDiagram
124124
participant Client as Client
125-
participant APIGateway as API Gateway
125+
participant APIGateway as API Gateway <br> (e.g. AWS API Gateway)
126126
participant Auth as Auth Provider
127-
participant Nitric as Nitric Runtime
127+
participant Nitric as Nitric Runtime <br> (plugin)
128128
participant SDK as Nitric SDK
129129
participant Worker as App Worker
130130

docs/architecture/buckets.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ sequenceDiagram
9494
participant Worker as App Worker(s)
9595
participant SDK as Nitric SDK
9696
participant Nitric as Nitric CLI
97-
participant Provider as Nitric Provider
98-
participant IAC as IaC
97+
participant Provider as Nitric Provider <br> (plugin)
98+
participant IAC as IaC <br> (e.g. Terraform)
9999
100100
Worker->>SDK: Register Bucket
101101
Worker->>SDK: Register Access Requirements
@@ -125,10 +125,10 @@ Below is a sequence diagram showing the runtime flow of a storage operation in a
125125
sequenceDiagram
126126
participant Client as App Code
127127
participant SDK as Nitric SDK
128-
participant Nitric as Nitric Runtime
129-
participant CloudAPI as Cloud Storage (e.g. S3)
128+
participant Nitric as Nitric Runtime <br> (plugin)
129+
participant CloudAPI as Cloud Storage <br> (e.g. AWS S3)
130130
131-
Client->>SDK: Read
131+
Client->>SDK: Read()
132132
SDK->>Nitric: Forward Request
133133
Nitric->>Nitric: Convert Request
134134
Nitric->>CloudAPI: Storage API Request

docs/architecture/keyvalue.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ sequenceDiagram
7979
participant Worker as App Worker(s)
8080
participant SDK as Nitric SDK
8181
participant Nitric as Nitric CLI
82-
participant Provider as Nitric Provider
83-
participant IAC as IaC
82+
participant Provider as Nitric Provider <br> (plugin)
83+
participant IAC as IaC <br> (e.g. Terraform)
8484
8585
Worker->>SDK: Register Key/Value Store
8686
Worker->>SDK: Register Access Requirements
@@ -100,8 +100,8 @@ Below is a sequence diagram showing the runtime flow of a key/value store operat
100100
sequenceDiagram
101101
participant Client as App Code
102102
participant SDK as Nitric SDK
103-
participant Nitric as Nitric Runtime
104-
participant CloudAPI as Document DB
103+
participant Nitric as Nitric Runtime <br> (plugin)
104+
participant CloudAPI as Document DB <br> (e.g. AWS DynamoDB)
105105
106106
Client->>SDK: Get(key)
107107
SDK->>Nitric: Forward Request

docs/architecture/queues.mdx

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,43 @@ classDef edgeLabel line-height:2;
6767

6868
## 2. Sequence
6969

70+
### Build Sequence
71+
72+
Below is a sequence diagram showing the sequence of events when a developer registers a Queue with Nitric. This is the process that occurs when using the `nitric up` command.
73+
74+
```mermaid
75+
sequenceDiagram
76+
participant Worker as App Worker(s)
77+
participant SDK as Nitric SDK
78+
participant Nitric as Nitric CLI
79+
participant Provider as Nitric Provider
80+
participant IAC as IaC
81+
82+
Worker->>SDK: Register Queue
83+
Worker->>SDK: Register Access Requirements
84+
SDK->>Nitric: Register Queue
85+
SDK->>Nitric: Register Access Requirements
86+
87+
Nitric->>Provider: Forward Nitric Spec
88+
Provider->>IAC: Provision Queue
89+
Provider->>IAC: Provision IAM
90+
```
91+
92+
### Runtime Sequence
93+
94+
Below is the runtime flow when performing operations on a Queue using Nitric, such as enqueueing or dequeueing messages. The example shows an Enqueue operation, which sends a message to the queue.
95+
7096
```mermaid
7197
sequenceDiagram
72-
participant Client as Client
73-
participant NitricSDK as Nitric SDK
74-
participant NitricRuntime as Nitric Runtime
75-
participant QueueService as Cloud Queue Service (e.g., AWS SQS, GCP Pub/Sub)
76-
77-
Client->>NitricSDK: Send or receive message from queue
78-
NitricSDK->>NitricRuntime: Forward queue API call
79-
NitricRuntime->>QueueService: Perform queue operation (e.g., enqueue, dequeue)
80-
81-
alt Successful Operation
82-
QueueService-->>NitricRuntime: Return result (e.g., message or success status)
83-
NitricRuntime-->>NitricSDK: Return result
84-
NitricSDK-->>Client: Return result to client
85-
else Failure
86-
QueueService-->>NitricRuntime: Return error
87-
NitricRuntime-->>NitricSDK: Forward error
88-
NitricSDK-->>Client: Return error response
89-
end
98+
participant Client as App Code
99+
participant SDK as Nitric SDK
100+
participant Nitric as Nitric Runtime <br> (plugin)
101+
participant CloudAPI as Document DB <br> (e.g. AWS SQS)
102+
103+
Client->>SDK: Enqueue(message)
104+
SDK->>Nitric: Forward Request
105+
Nitric->>Nitric: Convert Request
106+
Nitric->>CloudAPI: Queue API Request
90107
```
91108

92109
## 3. Component

docs/architecture/topics.mdx

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,59 @@ classDef edgeLabel line-height:2;
8282

8383
## 2. Sequence
8484

85+
### Build Sequence
86+
87+
Below is a sequence diagram showing the sequence of events when a developer registers a Topic with Nitric and optionally registers Subscribers. This is the process that occurs when using the `nitric up` command.
88+
89+
```mermaid
90+
sequenceDiagram
91+
participant Worker as App Worker(s)
92+
participant SDK as Nitric SDK
93+
participant Nitric as Nitric CLI
94+
participant Provider as Nitric Provider <br> (plugin)
95+
participant IAC as IaC <br> (e.g. Terraform)
96+
97+
Worker->>SDK: Register Queue
98+
Worker->>SDK: Register Access Requirements
99+
SDK->>Nitric: Register Queue
100+
SDK->>Nitric: Register Access Requirements
101+
102+
opt Subscribers
103+
Worker->>SDK: Register Subscriber Callback
104+
SDK->>Nitric: Register Subscriber
105+
end
106+
107+
Nitric->>Provider: Forward Nitric Spec
108+
Provider->>IAC: Provision Queue
109+
Provider->>IAC: Provision IAM
110+
111+
opt Notifications
112+
Provider->>IAC: Provision Event Rule(s)
113+
Provider->>IAC: Provision IAM
114+
end
115+
```
116+
117+
### Runtime Sequence
118+
119+
Below is the runtime flow when performing operations on a Topic using Nitric, such as publishing or subscribing to messages. The example shows both publish and subscribe operations, which send or receive messages to/from the topic.
120+
85121
```mermaid
86122
sequenceDiagram
87-
participant Client as Client
88-
participant NitricSDK as Nitric SDK
89-
participant NitricRuntime as Nitric Runtime
90-
participant TopicService as Cloud Topic Service (e.g., AWS SNS, GCP Pub/Sub)
91-
participant Subscriber as Subscriber (e.g., Queue, Function)
92-
93-
Client->>NitricSDK: Publish message to topic
94-
NitricSDK->>NitricRuntime: Forward topic API call
95-
NitricRuntime->>TopicService: Publish message to topic
96-
97-
alt Successful Publish
98-
TopicService-->>NitricRuntime: Confirm message delivery
99-
NitricRuntime-->>NitricSDK: Return success confirmation
100-
NitricSDK-->>Client: Return success to client
101-
TopicService->>Subscriber: Distribute message to subscribers
102-
Subscriber-->>TopicService: Acknowledge receipt of message
103-
else Publish Failure
104-
TopicService-->>NitricRuntime: Return error
105-
NitricRuntime-->>NitricSDK: Forward error
106-
NitricSDK-->>Client: Return error response
123+
participant Client as App Code
124+
participant SDK as Nitric SDK
125+
participant Nitric as Nitric Runtime <br> (plugin)
126+
participant CloudAPI as Message Broker <br> (e.g. AWS SNS)
127+
128+
alt Publisher
129+
Client->>SDK: Publish(message)
130+
SDK->>Nitric: Forward Request
131+
Nitric->>Nitric: Convert Request
132+
Nitric->>CloudAPI: Topic API Request
133+
else Subscriber
134+
CloudAPI->>Nitric: Message
135+
Nitric->>Nitric: Convert Message
136+
Nitric->>SDK: Forward Message
137+
SDK->>Client: Subscription Callback
107138
end
108139
```
109140

0 commit comments

Comments
 (0)