Documentation
¶
Overview ¶
Package queue implements the asynchronous queue lifecycle: submit, poll, fetch result, cancel and subscribe. It is surfaced through fal.Client (Submit, Subscribe, Status, Result, Cancel, GetHandle) and the matching package-level functions; the Handle type is re-exported as fal.RequestHandle.
Index ¶
- func Cancel(ctx context.Context, core *transport.Core, application, requestID string) error
- func Result(ctx context.Context, core *transport.Core, application, requestID string) (any, error)
- func Status(ctx context.Context, core *transport.Core, application, requestID string, ...) (status.Status, error)
- func Subscribe(ctx context.Context, core *transport.Core, application string, arguments any, ...) (any, error)
- type Handle
- func (h *Handle) Cancel(ctx context.Context) error
- func (h *Handle) Get(ctx context.Context) (any, error)
- func (h *Handle) IterEvents(ctx context.Context, withLogs bool, interval time.Duration) iter.Seq2[status.Status, error]
- func (h *Handle) Status(ctx context.Context, withLogs bool) (status.Status, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Result ¶
Result polls a request by id until completion and returns its result. It mirrors fal_client.result.
Types ¶
type Handle ¶
type Handle struct {
RequestID string
ResponseURL string
StatusURL string
CancelURL string
// contains filtered or unexported fields
}
Handle references a submitted queue request. It mirrors fal_client.SyncRequestHandle and is re-exported as fal.RequestHandle.
func GetHandle ¶
GetHandle reconstructs a handle from an application id and request id. It mirrors SyncClient.get_handle / SyncRequestHandle.from_request_id.
func Submit ¶
func Submit(ctx context.Context, core *transport.Core, application string, arguments any, o *option.CallOptions) (*Handle, error)
Submit enqueues a request and returns a handle to poll it. It mirrors fal_client.submit / SyncClient.submit.
func (*Handle) Get ¶
Get polls until completion and returns the result. It mirrors SyncRequestHandle.get.
func (*Handle) IterEvents ¶
func (h *Handle) IterEvents(ctx context.Context, withLogs bool, interval time.Duration) iter.Seq2[status.Status, error]
IterEvents polls the request at the given interval, yielding each status until (and including) the Completed status. A non-nil error is yielded once and ends iteration; breaking early stops polling. It mirrors SyncRequestHandle.iter_events.