Containers

Containers

Containers are an abstraction which describes task assignment. A container is an ordered list of tasks. Tasks always belong to exactly one container -- once created and when reassigned. When a task is started by a worker, it is no longer part of that container's tasks. Organizations, teams and workers all correspond to containers as they can all be assigned tasks.

The generic way to perform assignment operations is by using a container endpoint. Note that all containers have a hard limit of 10,000 assigned tasks.

Conceptually, a container mutation operation allows you to alter the tasks which are in a container, either by setting the list or by inserting new tasks into the list. Note that, in order to ensure the integrity of a container, locking is used. This means that if you are issuing many concurrent requests against the same container (by directly interacting with it or indirectly, by creating unassigned tasks, for example), you will create contention which will result in slower response times and possibly 412 PreconditionFailedError responses. If you see this, please slow down a bit and try to perform these operations serially.

When setting tasks in a container, newly included tasks will be removed from other containers. When a task is removed from a container implicitly by omission (for example, setting a container to include tasks A and C when it previously included A, B, and C, thus removing B), this task will be appended to the organization container for the task's executor organization.

Likewise, when inserting tasks into a container, newly included tasks will be removed from other containers.

You can perform advanced assignment operations by interacting with a container's tasks array property directly.

A single endpoint allows for these interactions: PUT /containers/:containerType/:entityId, where containerType is either organizations, teams or workers and entityId is the ID of the entity with the given type against which to perform the assignment operations.