Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Regional Webhook Spoke

Back to distributed sample overview

The regional spoke receives work already selected by the dispatcher. It verifies the internal signature, writes regional state, and hands start or stop events to local compute.

It should not decide which global region owns the stream. That decision belongs upstream.

Recovery stays with the selected regional owner. When the spoke receives rtms_interrupted or a fresh active-stream rtms_started for a stream already owned in the region, it writes the recovery envelope into the regional control store so the current compute Job can observe it during lease renewal.

Endpoints

Endpoint Purpose
GET /health Spoke config and state
GET /local/events Local test/debug event list
POST /spoke/webhook Signed internal webhook envelope

Run

SPOKE_REGION=IAD \
SPOKE_PORT=4200 \
INTERNAL_WEBHOOK_SECRET=internal-secret \
REGIONAL_STORE_URL=http://127.0.0.1:4101 \
COMPUTE_ENDPOINTS='["http://127.0.0.1:4710/compute/webhook"]' \
npm run start:spoke

For a distributed deployment, REGIONAL_STORE_URL and COMPUTE_ENDPOINTS should be full URLs reachable from this spoke. They can be FQDNs or private service DNS names, not only host:port pairs.

Main Config

Key Purpose
SPOKE_REGION Region label for this spoke
SPOKE_PORT Local listen port, default 4200
REGIONAL_STORE_URL Regional control store URL
COMPUTE_ENDPOINTS JSON array of compute launcher/worker URLs
INTERNAL_WEBHOOK_SECRET Required HMAC secret

Related