Skip to content

w7s-io/example-queue-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-queue-worker

Small W7S backend that declares a queue, enqueues work through env.W7S_QUEUE, and consumes queue batches in the same backend.

Public endpoints

GET  https://w7s-io.w7s.cloud/example-queue-worker/
POST https://w7s-io.w7s.cloud/example-queue-worker/enqueue
GET  https://w7s-io.w7s.cloud/example-queue-worker/last
GET  https://w7s-io.w7s.cloud/example-queue-worker/health

/enqueue sends a JSON message through:

env.W7S_QUEUE.fetch("https://w7s.internal/api/v1/queues/w7s-io/example-queue-worker/jobs")

W7S delivers the batch back to this backend at:

/_w7s/queues/jobs

The consumer stores the latest processed message in the per-app STATE KV binding, so /last can verify delivery.

Manifest

{
  "bindings": {
    "kv": ["STATE"]
  },
  "queues": ["jobs"]
}

Deploy

This repo deploys on every push with:

- uses: w7s-io/w7s-cloud@v1
  with:
    token: ${{ github.token }}

The workflow smoke test enqueues a message and polls /last until the queue consumer has processed it.

About

W7S backend queue example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors