https://github.com/mduesterhoeft/websocket-step-function
https://github.com/mduesterhoeft/websocket-step-function
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mduesterhoeft/websocket-step-function
- Owner: mduesterhoeft
- Created: 2019-09-09T19:58:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:38:51.000Z (over 3 years ago)
- Last Synced: 2023-03-03T04:07:40.265Z (over 3 years ago)
- Language: Python
- Homepage:
- Size: 669 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# websocket-step-function
This demo application show how to use WebSockets over API Gateway to publish the state of long-running interactions to a client.
The long running task is simulated by a step function.
## Run the application
Deploy the application.
```
serverless deploy
```
Kick off the long-running tasks (step function)
```
http POST https://.execute-api.eu-central-1.amazonaws.com/dev/tasks
```
Copy the `taskId` from the response and establish the connection to the WebSocket API
```
websocat wss://.execute-api.eu-central-1.amazonaws.com/dev
```
Send a message to the server by pasting the `taskId` into the terminal.
After the long-running interaction has finished the server sends a message in turn that indicated the status of the interaction.