Documentation
¶
Overview ¶
Package httpqueue implements queue.Queue and queue.Results over the dispatch control plane's HTTP API. It is what remote consumers — the `dispatch work` process that Kubernetes pods and serverless containers replicate — use to compete for tasks on a deployment's queue, and what their tools spawn sub-tasks through. No broker is required: the control plane service is the rendezvous point.
Index ¶
- type Client
- func (c *Client) Await(ctx context.Context, taskID string) (task.Result, error)
- func (c *Client) Dequeue(ctx context.Context) (task.Task, error)
- func (c *Client) Enqueue(ctx context.Context, t task.Task) error
- func (c *Client) Get(ctx context.Context, taskID string) (task.Result, bool, error)
- func (c *Client) Report(ctx context.Context, r task.Result) error
- func (c *Client) Spec(ctx context.Context) (controlplane.ServiceSpec, error)
- func (c *Client) SubmitAsync(ctx context.Context, t task.Task) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// LeaseWait is the long-poll duration per lease request (default 30s).
LeaseWait time.Duration
// PollInterval is the result polling cadence for Await (default 500ms).
PollInterval time.Duration
// contains filtered or unexported fields
}
Client speaks to one deployment on one control plane server.
func New ¶
New returns a client for deployment on the control plane at baseURL (e.g. "http://dispatch:8484").
func (*Client) Dequeue ¶
Dequeue implements queue.Queue by long-polling the deployment's lease endpoint until a task arrives or ctx is done.
func (*Client) Spec ¶
func (c *Client) Spec(ctx context.Context) (controlplane.ServiceSpec, error)
Spec fetches the deployment's service spec so a remote consumer can reconstruct its sandbox policies.