httpqueue

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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

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

func New(baseURL, deployment string) *Client

New returns a client for deployment on the control plane at baseURL (e.g. "http://dispatch:8484").

func (*Client) Await

func (c *Client) Await(ctx context.Context, taskID string) (task.Result, error)

Await implements queue.Results by polling Get.

func (*Client) Dequeue

func (c *Client) Dequeue(ctx context.Context) (task.Task, error)

Dequeue implements queue.Queue by long-polling the deployment's lease endpoint until a task arrives or ctx is done.

func (*Client) Enqueue

func (c *Client) Enqueue(ctx context.Context, t task.Task) error

Enqueue implements queue.Queue.

func (*Client) Get

func (c *Client) Get(ctx context.Context, taskID string) (task.Result, bool, error)

Get implements queue.Results.

func (*Client) Report

func (c *Client) Report(ctx context.Context, r task.Result) error

Report implements queue.Results.

func (*Client) Spec

Spec fetches the deployment's service spec so a remote consumer can reconstruct its sandbox policies.

func (*Client) SubmitAsync

func (c *Client) SubmitAsync(ctx context.Context, t task.Task) (string, error)

SubmitAsync enqueues t on the deployment and returns its task ID. It is the Spawner remote nodes hand to their tools.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL