semaphoreclient

package
v1.340.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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