semaphoreclient

package
v1.322.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package semaphoreclient is the Temporal client side of the mobile-device semaphore workflow, shared by the HTTP handlers and the enqueue activity.

Index

Constants

View Source
const (
	// WaitTimeoutEnv names the variable bounding how long a ticket may stay
	// queued before the semaphore fails it.
	WaitTimeoutEnv = "MOBILE_RUNNER_SEMAPHORE_WAIT_TIMEOUT"
	// DefaultWaitTimeout applies when WaitTimeoutEnv is unset or invalid: no timeout.
	DefaultWaitTimeout time.Duration = 0
)

Variables

View Source
var ErrRunTicketNotFound = errors.New("run ticket not found")

ErrRunTicketNotFound signals that a run ticket could not be located in a device queue.

Functions

func CancelRun

CancelRun removes a run ticket from the device semaphore.

func EnqueueRun

EnqueueRun enqueues a run ticket on the device semaphore, starting the semaphore workflow in the same call when it is not running.

func EnsureWorkflow

func EnsureWorkflow(ctx context.Context, c client.Client, deviceID string) error

EnsureWorkflow starts the device semaphore workflow unless it is already running.

func UpdateID

func UpdateID(prefix, deviceID, ticketID string) string

UpdateID builds the stable update ID of a semaphore update for a ticket.

func WaitTimeoutSeconds added in v1.322.1

func WaitTimeoutSeconds() int

WaitTimeoutSeconds returns the queue wait timeout to put in an enqueue request: WaitTimeoutEnv as a time.ParseDuration value ("0" disables it), or DefaultWaitTimeout (no timeout) when the variable is unset or invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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