Class/Object

agora.rest.exchange

ExchangeClient

Related Docs: object ExchangeClient | package exchange

Permalink

class ExchangeClient extends Exchange with RoutingClient with FailFastCirceSupport with AutoCloseable with StrictLogging

Represents a something that will request work and get a response.

A normal workflow would be to request work from an exchange, have that work eventually matched with a worker, and then receive a 307 response, telling us where to go.

We then make a request (typically the original one, but perhaps not if it was e.g. a multipart request w/ a large upload or summat) to that worker.

Linear Supertypes
StrictLogging, AutoCloseable, FailFastCirceSupport, FailFastUnmarshaller, BaseCirceSupport, RoutingClient, Exchange, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExchangeClient
  2. StrictLogging
  3. AutoCloseable
  4. FailFastCirceSupport
  5. FailFastUnmarshaller
  6. BaseCirceSupport
  7. RoutingClient
  8. Exchange
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExchangeClient(rest: RestClient, mkWorker: (HostLocation) ⇒ Dispatch)

    Permalink

Type Members

  1. type JobResponse = Future[_ <: ClientResponse]

    Permalink
  2. type WorkerCallback = (WorkerClient, WorkerDetails)

    Permalink
    Definition Classes
    RoutingClient
  3. type WorkerResponses = Future[CompletedWork]

    Permalink
    Definition Classes
    RoutingClient

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def cancelJobs(request: CancelJobs): Future[CancelJobsResponse]

    Permalink
    Definition Classes
    ExchangeClient → Exchange
  6. final def cancelJobs(job: JobId, theRest: JobId*): Future[CancelJobsResponse]

    Permalink
    Definition Classes
    Exchange
  7. def cancelSubscriptions(request: CancelSubscriptions): Future[CancelSubscriptionsResponse]

    Permalink
    Definition Classes
    ExchangeClient → Exchange
  8. final def cancelSubscriptions(id: SubscriptionKey, theRest: SubscriptionKey*): Future[CancelSubscriptionsResponse]

    Permalink
    Definition Classes
    Exchange
  9. def clientFor(location: HostLocation): Dispatch

    Permalink
    Attributes
    protected
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def close(): Unit

    Permalink
    Definition Classes
    ExchangeClient → AutoCloseable
  12. def enqueue(submit: SubmitJob): WorkerResponses

    Permalink

    Similar to 'submit', but returns the result from the worker.

    Similar to 'submit', but returns the result from the worker.

    This assumes the job submitted to the exchange can be sent verbatim to the worker.

    The workflow is:

    1) submit to exchange, awaiting a match 2) on (redirect) response (when a worker is eventually assigned), submit the work to the matched worked 3) return the response from the worker ... which could be *anything*

    submit

    the job submission

    returns

    the worker response

    Definition Classes
    RoutingClient
  13. def enqueueAndDispatch(submit: SubmitJob)(sendToWorker: (WorkerClient) ⇒ Future[HttpResponse]): (JobResponse, WorkerResponses)

    Permalink

    Submit the job, then on the (expected) redirect response, route the work to the given worker using the 'sendToWorker'

    Submit the job, then on the (expected) redirect response, route the work to the given worker using the 'sendToWorker'

    submit

    the job to submit

    sendToWorker

    the function used to send work to the worker (which may or may not have been the same request)

    returns

    both the original work submission response and the response from the worker

    Definition Classes
    RoutingClient
  14. def enqueueAs[T](submit: SubmitJob)(implicit arg0: FromResponseUnmarshaller[T]): Future[T]

    Permalink

    Convenience method for enqueueing the request, awaiting for a single worker and then returning the unmarshalled response

    Convenience method for enqueueing the request, awaiting for a single worker and then returning the unmarshalled response

    T

    the response type

    submit

    the job to submit

    returns

    the single unmarshalled response

    Definition Classes
    RoutingClient
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. implicit def execContext: ExecutionContext

    Permalink
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. implicit final def jsonMarshaller(implicit printer: Printer): ToEntityMarshaller[Json]

    Permalink
    Definition Classes
    BaseCirceSupport
  23. implicit final val jsonUnmarshaller: FromEntityUnmarshaller[Json]

    Permalink
    Definition Classes
    BaseCirceSupport
  24. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  25. implicit final def marshaller[A](implicit arg0: Encoder[A], printer: Printer): ToEntityMarshaller[A]

    Permalink
    Definition Classes
    BaseCirceSupport
  26. implicit def materializer: Materializer

    Permalink
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. def onClientRequest(request: ClientRequest): Future[ClientResponse]

    Permalink
    Definition Classes
    Exchange
  31. def onSubmitResponse(resp: BlockingSubmitJobResponse)(sendToWorker: (WorkerClient) ⇒ Future[HttpResponse]): WorkerResponses

    Permalink
    Attributes
    protected
    Definition Classes
    RoutingClient
  32. def onSubscriptionRequest(req: SubscriptionRequest): Future[SubscriptionResponse]

    Permalink
    Definition Classes
    Exchange
  33. def queueState(request: QueueState = QueueState()): Future[QueueStateResponse]

    Permalink
    Definition Classes
    ExchangeClient → Exchange
  34. val rest: RestClient

    Permalink
  35. def retryOnError[A](retry: ⇒ Future[A]): (HandlerError) ⇒ Future[A]

    Permalink

    What an odd signature!

    What an odd signature!

    This is to match the 'as' function used to map http responses to some type 'T'.

    in the event of a failure (exception or non-success server response), we can optionally retry. The 'retry' function is given first so that the second param list matches that of the 'as' result

    Attributes
    protected
  36. def submit(submit: SubmitJob): JobResponse

    Permalink
    Definition Classes
    ExchangeClient → Exchange
  37. def subscribe(request: WorkSubscription): Future[WorkSubscriptionAck]

    Permalink
    Definition Classes
    ExchangeClient → Exchange
  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def take(request: RequestWork): Future[RequestWorkAck]

    Permalink
    Definition Classes
    ExchangeClient → Exchange
  40. def take(id: SubscriptionKey, itemsRequested: Int): Future[RequestWorkAck]

    Permalink
    Definition Classes
    Exchange
  41. def toString(): String

    Permalink
    Definition Classes
    ExchangeClient → AnyRef → Any
  42. implicit final def unmarshaller[A](implicit arg0: Decoder[A]): FromEntityUnmarshaller[A]

    Permalink
    Definition Classes
    FailFastUnmarshaller
  43. def unmarshallerContentTypes: Seq[ContentTypeRange]

    Permalink
    Definition Classes
    BaseCirceSupport
  44. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StrictLogging

Inherited from AutoCloseable

Inherited from FailFastCirceSupport

Inherited from FailFastUnmarshaller

Inherited from BaseCirceSupport

Inherited from RoutingClient

Inherited from Exchange

Inherited from AnyRef

Inherited from Any

Ungrouped