-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68eb785
commit ec7b7aa
Showing
8 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
```mermaid | ||
sequenceDiagram | ||
participant Client2 | ||
participant Client | ||
participant Server | ||
Client->>Server: POST /data (Idempotency-Key=1) | ||
activate Server | ||
Server->>Store: Check for Idempotency-Key=1 (Not Found) | ||
activate Store | ||
deactivate Store | ||
Server->>Server: Process Requesy | ||
Server->>Store: Store Response(Idempotency-Key=1) | ||
activate Store | ||
deactivate Store | ||
alt Timed Out/Server Crash/Connection Lost | ||
Server-xClient: No Repsponse | ||
else Client Crash | ||
Server-xClient: 201 Created | ||
end | ||
deactivate Server | ||
Client->>Server: POST /data (Retry, Idempotency-Key=1) | ||
activate Server | ||
Server->>Store: Check Idempotency-Key=1 (Exists) | ||
activate Store | ||
deactivate Store | ||
Server->>Client: 201 OK (Duplicate Request) | ||
deactivate Server | ||
Client->>Server: POST /data (Idempotency-Key=2) | ||
activate Client | ||
activate Server | ||
Server->>Store: Check Idempotency-Key=2 (Not Exists) | ||
activate Store | ||
deactivate Store | ||
Server->>Server: Process Request | ||
Client2->>Server: POST /data (concurrent Req, Idempotency-Key=2) | ||
activate Client2 | ||
Server->>Store: Check Idempotency-Key=2 (In-Progress) | ||
activate Store | ||
deactivate Store | ||
Server->>Client2: 409 Conflict, Retry-After=1 | ||
deactivate Client2 | ||
Server->>Client: 201 Created | ||
deactivate Server | ||
deactivate Client | ||
Client2->>Server: POST /data (Retried After, Idempotency-Key=2) | ||
activate Client2 | ||
activate Server | ||
Server->>Store: Check Idempotency-Key (Exists) | ||
activate Store | ||
deactivate Store | ||
Server->>Client2: 201 Created | ||
deactivate Client2 | ||
deactivate Server | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
#### node-idempotency/shared | ||
|
||
Hey there!!! Thanks for landing here, you are probably not interested in this package but these, | ||
|
||
- [`@node-idempotency/nestjs`](https://www.npmjs.com/package/@node-idempotency/nestjs) - Plug and Play `nestjs` wrapper for `@node-idempotency/core` | ||
|
||
- [`@node-idempotency/express`](https://www.npmjs.com/package/@node-idempotency/express) - Plug and Play `express` middleware for `@node-idempotency/core` | ||
|
||
- [`@node-idempotency/fastify`](https://www.npmjs.com/package/@node-idempotency/fastify) - Plug and Play `fastify` plugin for `@node-idempotency/core` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
#### @node-idempotency/storage | ||
|
||
Storage adapter interace for [@node-idempotency](https://www.npmjs.com/package/@node-idempotency/core). | ||
|
||
Checkout these, | ||
|
||
- [`@node-idempotency/nestjs`](https://www.npmjs.com/package/@node-idempotency/nestjs) - Plug and Play `nestjs` wrapper for `@node-idempotency/core` | ||
|
||
- [`@node-idempotency/express`](https://www.npmjs.com/package/@node-idempotency/express) - Plug and Play `express` middleware for `@node-idempotency/core` | ||
|
||
- [`@node-idempotency/fastify`](https://www.npmjs.com/package/@node-idempotency/fastify) - Plug and Play `fastify` plugin for `@node-idempotency/core` |