Skip to main content
A queue passes work items between processes, and a map holds temporary shared values. Within a workspace, a queue or map with the same name refers to the same data.

Queue

Queue is a FIFO queue of JSON-serializable values:
pop() hands each item to exactly one caller, or returns None when empty. Work that needs results and retries fits a function call better.

Coordinate containers

.map() fits inputs known up front. A queue fits work discovered along the way, drained by a few long-lived workers, with a map to share progress:
Eight workers drain one queue in parallel. The in check and set are two calls, so two workers can occasionally fetch the same URL. A crawler shrugs that off, and a payment can’t, so exactly-once work belongs in an idempotent handler or a function call. A worker that crashes after pop() loses the item, since the queue has no acknowledgement.

Map

Map is a key/value store with the MutableMapping interface:
Keys expire after seven days, the longest timed expiry, and ttl=0 keeps a key until deleted.

Edit from the dashboard

The dashboard inspects and edits both by hand.

Delete a queue or map

q.delete() removes the queue and its remaining items. state.delete() removes the map and all its keys.