QueueClient

interface QueueClient

A Kotlin queue client for interacting with the fal queue APIs.

See also

AsyncQueueClient

Functions

Link copied to clipboard
abstract suspend fun <Output : Any> result(endpointId: String, requestId: String, resultType: KClass<Output>): RequestOutput<Output>

Gets the result of the request with the given requestId.

Link copied to clipboard
inline suspend fun <Output : Any> QueueClient.result(endpointId: String, requestId: String): RequestOutput<Output>
Link copied to clipboard
abstract suspend fun status(endpointId: String, requestId: String, options: StatusOptions = StatusOptions()): QueueStatus.StatusUpdate

Gets the current status of the request with the given requestId.

Link copied to clipboard
abstract suspend fun <Input> submit(endpointId: String, input: Input, options: SubmitOptions = SubmitOptions()): QueueStatus.InQueue

Submits a request to the given endpointId. This method uses the Queue API to submit the request and returns the initial status of the request.

Link copied to clipboard
abstract suspend fun subscribeToStatus(endpointId: String, requestId: String, options: StatusSubscribeOptions = StatusSubscribeOptions(), onQueueUpdate: OnStatusUpdate? = null): QueueStatus.Completed

Subscribes to the status updates of the request with the given requestId. This method uses the Queue API to subscribe to the status updates of the request.