Class/Object

jabroni.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, NoSpacesPrinter, BaseCirceSupport, RoutingClient, Exchange, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExchangeClient
  2. StrictLogging
  3. AutoCloseable
  4. FailFastCirceSupport
  5. FailFastUnmarshaller
  6. NoSpacesPrinter
  7. BaseCirceSupport
  8. RoutingClient
  9. Exchange
  10. AnyRef
  11. 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)(doWork: (WorkerClient) ⇒ Future[HttpResponse]): (JobResponse, WorkerResponses)

    Permalink

    Enqueues the given job, then uses the supplied function to send the matched work to the workers

    Enqueues the given job, then uses the supplied function to send the matched work to the workers

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

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

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

    Permalink
  17. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  21. implicit final val jsonMarshaller: ToEntityMarshaller[Json]

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

    Permalink
    Definition Classes
    BaseCirceSupport
  23. val logger: Logger

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

    Permalink
    Definition Classes
    BaseCirceSupport
  25. implicit def materializer: Materializer

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

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

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

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

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

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

    Permalink
    Definition Classes
    Exchange
  32. final def printer: Printer

    Permalink
    Definition Classes
    NoSpacesPrinter
  33. def queueState(request: QueuedState = QueuedState()): Future[QueuedStateResponse]

    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 sendAndRouteWorkerRequest(submit: SubmitJob)(sendToWorker: (WorkerClient) ⇒ Future[HttpResponse]): (JobResponse, WorkerResponses)

    Permalink

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

    Submit the job, then on the (expected) rediret 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
  37. def submit(submit: SubmitJob): Future[ClientResponse]

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

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

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

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

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

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

    Permalink
    Definition Classes
    FailFastUnmarshaller
  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 NoSpacesPrinter

Inherited from BaseCirceSupport

Inherited from RoutingClient

Inherited from Exchange

Inherited from AnyRef

Inherited from Any

Ungrouped