LIVE VIEW + SERVER
Publish an application event
The Queue connection and credentials never leave the server. The View only submits event data and receives ok plus messageId.
Receipt: {lastId}
SERVER BLOCK / QUEUE
Publish durable work
A View sends a JSON event to a server handler. The handler uses a server-only Queue connection and returns the provider receipt.
LIVE VIEW + SERVER
Publish an application event
The Queue connection and credentials never leave the server. The View only submits event data and receives ok plus messageId.
Receipt: {lastId}
BEFORE YOU CLICK
Local development uses Dowe and targets an existing queue. On deploy, the same handler can select RabbitMQ, Cloudflare, or Vercel through its server-only connection; provision the remote queue before publishing.
dowe queue init dowe-docs
dowe queue declare dowe-docs docs-eventsSOURCE FILES
Explicit connection, explicit destination
The application publishes to a queue that was already provisioned. Consume, ACK, and NACK stay in the streaming Rust provider API.
signal eventForm value:{ event:"docs.started" message:"Dowe server block" }
fn publishEvent
request result method:"POST" route:"/api/examples/queue" body:eventForm
if result.ok
set lastId value:result.messageId
Button onClick:publishEvent
"Publish event"import { ExamplesQueue } from "@/server/config/examples"
handler publishExampleEvent
const body value:req.json
msg sent conn:ExamplesQueue.publish queue:"docs-events" payload:{ event:body.event payload:{ message:body.message } }
return json:{ ok:sent.ok messageId:sent.id }queue ExamplesQueue provider:"dowe" host:env.QUEUE_HOST port:env.QUEUE_PORT account:env.QUEUE_ACCOUNT secret:env.QUEUE_SECRET vhost:env.QUEUE_VHOSTdowe queue init dowe-docs
dowe queue declare dowe-docs docs-events
dowe queue publish dowe-docs docs-events '{"event":"docs.started","payload":{"message":"Dowe server block"}}'