Class QueueClientImpl

java.lang.Object
ai.fal.client.queue.QueueClientImpl
All Implemented Interfaces:
QueueClient

public class QueueClientImpl extends Object implements QueueClient
  • Constructor Details

    • QueueClientImpl

      public QueueClientImpl(@Nonnull HttpClient httpClient)
  • Method Details

    • submit

      @Nonnull public QueueStatus.InQueue submit(@Nonnull String endpointId, @Nonnull QueueSubmitOptions options)
      Description copied from interface: QueueClient
      Submit a payload to an endpoint's queue.
      Specified by:
      submit in interface QueueClient
      Parameters:
      endpointId - the endpoint to submit to (e.g. `fal-ai/fast-sdxl`)
      options - the submit options
      Returns:
      the status of the submission with the `requestId` for tracking the submission.
    • status

      @Nonnull public QueueStatus.StatusUpdate status(@Nonnull String endpointId, @Nonnull QueueStatusOptions options)
      Description copied from interface: QueueClient
      Check the status of a submission.
      Specified by:
      status in interface QueueClient
      Parameters:
      endpointId - the endpoint to cancel the submission for
      options - the status check options
      Returns:
      the status of the submission
    • subscribeToStatus

      @Nonnull public QueueStatus.Completed subscribeToStatus(@Nonnull String endpointId, @Nonnull QueueSubscribeOptions options)
      Description copied from interface: QueueClient
      Subscribe to the status of a submission.
      Specified by:
      subscribeToStatus in interface QueueClient
      Parameters:
      endpointId - the endpoint to subscribe to the status for
      options - the subscribe options
      Returns:
      the status of the submission
    • result

      @Nonnull public <O> Output<O> result(@Nonnull String endpointId, @Nonnull QueueResultOptions<O> options)
      Description copied from interface: QueueClient
      Get the result of a submission.
      Specified by:
      result in interface QueueClient
      Type Parameters:
      O - the type of the output payload
      Parameters:
      endpointId - the endpoint to get the result for
      options - the response options
      Returns:
      the result of the submission