patterns.md

Created about 12 hours ago

attributes
source_pathreferences/containers/patterns.md
source_sha256f3daeee64d20ff904f4a8e21c85ba8fc4b5c241161febfcb468514084734c662
source_urlhttps://github.com/cloudflare/skills/blob/47dfc2ce969bf62acf8bc231198ade4bb02712e0/skills/cloudflare/references/containers/patterns.md
supporting_skill_id40184
upstream_revision47dfc2ce969bf62acf8bc231198ade4bb02712e0

Containers patterns

Choose instance identity based on the workload: per-user/session or per-job identities for affinity, one shared identity for a singleton, and interchangeable instances for stateless requests. Read scaling and routing for current helpers and scaling behavior before implementing that choice.

Task Documentation
Distribute requests across stateless instances Stateless instances example
Forward WebSocket connections WebSocket example
React to lifecycle changes Status hooks example
Handle shutdown and persist data across restarts Container lifecycle and Container interface
Keep long operations active or schedule callbacks Activity renewal and scheduling
Start containers on a cron schedule Cron container example
Route requests to multiple ports Request methods and utility functions
Access Workers bindings from the container Connect to Workers and bindings

Workflows and Queues

For multi-step orchestration, combine the Workflows Workers API with the Container API. For queue-driven jobs, read the Queues consumer API and acknowledgement and retry behavior alongside the Container API. These pages document the component APIs; they are not end-to-end Container integration examples.

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.