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
- Variables
- func CancelRun(ctx context.Context, c client.Client, deviceID string, ...) (mobiledevicesemaphore.MobileDeviceSemaphoreRunStatusView, error)
- func EnqueueRun(ctx context.Context, c client.Client, deviceID string, ...) (mobiledevicesemaphore.MobileDeviceSemaphoreEnqueueRunResponse, error)
- func EnsureWorkflow(ctx context.Context, c client.Client, deviceID string) error
- func UpdateID(prefix, deviceID, ticketID string) string
- func WaitTimeoutSeconds() int
Constants ¶
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 ¶
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 ¶
func CancelRun( ctx context.Context, c client.Client, deviceID string, req mobiledevicesemaphore.MobileDeviceSemaphoreRunCancelRequest, ) (mobiledevicesemaphore.MobileDeviceSemaphoreRunStatusView, error)
CancelRun removes a run ticket from the device semaphore.
func EnqueueRun ¶
func EnqueueRun( ctx context.Context, c client.Client, deviceID string, req mobiledevicesemaphore.MobileDeviceSemaphoreEnqueueRunRequest, ) (mobiledevicesemaphore.MobileDeviceSemaphoreEnqueueRunResponse, error)
EnqueueRun enqueues a run ticket on the device semaphore, starting the semaphore workflow in the same call when it is not running.
func EnsureWorkflow ¶
EnsureWorkflow starts the device semaphore workflow unless it is already running.
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.