https://github.com/garysassano/wrangler-cloudflare-durable-objects-queue
Wrangler app showing how to create durable objects that publish messages to a queue
https://github.com/garysassano/wrangler-cloudflare-durable-objects-queue
cloudflare cloudflare-do cloudflare-durable-objects cloudflare-queues cloudflare-workers wrangler
Last synced: about 2 months ago
JSON representation
Wrangler app showing how to create durable objects that publish messages to a queue
- Host: GitHub
- URL: https://github.com/garysassano/wrangler-cloudflare-durable-objects-queue
- Owner: garysassano
- Created: 2024-05-12T13:38:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-28T22:23:39.000Z (12 months ago)
- Last Synced: 2024-05-29T13:21:35.957Z (12 months ago)
- Topics: cloudflare, cloudflare-do, cloudflare-durable-objects, cloudflare-queues, cloudflare-workers, wrangler
- Language: TypeScript
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wrangler-cloudflare-durable-objects-queue
Wrangler app that uses a Durable Object to publish messages to a queue.
## Prerequisites
- **_Cloudflare:_**
- Must have set the `CLOUDFLARE_API_TOKEN` variable in your local environment.
- **_pnpm:_**
- Must be [installed](https://pnpm.io/installation) in your system.
- **_Wrangler:_**
- Must be [installed](https://developers.cloudflare.com/workers/wrangler/install-and-update/) in your system.## Deployment
Create queue:
```sh
npx wrangler queues create my-queue
```Create worker:
```sh
npx wrangler deploy
```## Usage
1. Grab the `` from the deployment:
```sh
Published my-worker
Producer for my-queue
```2. Navigate to `https://my-worker..workers.dev?userId=test`.
3. Check that a message is present in `my-queue` from the Cloudflare dashboard.
## Cleanup
```sh
npx wrangler delete
```## Architecture Diagram
