Class/Object

agora.api.exchange

ServerSideExchange

Related Docs: object ServerSideExchange | package exchange

Permalink

case class ServerSideExchange(underlying: Exchange, observer: MatchObserver = MatchObserver())(implicit ec: ExecutionContext) extends Exchange with Product with Serializable

Adds a special type for local exchanges. also exposing a means to observe jobs.

This way the 'MatchObserver' provided to the Exchange is accessible. Also, as convenient as it is to provide multiple implementations of a generic Exchange (i.e. local and remote), It's useful to know the intent when wiring together components (e.g. so we don't have a REST service configured which just sends exchange requests to itself)

Linear Supertypes
Serializable, Serializable, Product, Equals, Exchange, JobSyntax, StrictLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerSideExchange
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. Exchange
  7. JobSyntax
  8. StrictLogging
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ServerSideExchange(underlying: Exchange, observer: MatchObserver = MatchObserver())(implicit ec: ExecutionContext)

    Permalink

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. final def cancelJobs(job: JobId, theRest: JobId*): Future[CancelJobsResponse]

    Permalink
    Definition Classes
    Exchange
  6. def cancelJobs(request: CancelJobs): Future[CancelJobsResponse]

    Permalink

    Cancels the submitted jobs, removing them from the exchange

    Cancels the submitted jobs, removing them from the exchange

    request

    the request containing the jobs to cancel

    returns

    a response containing a map between the input job Ids and a flag depicting if they were successfully cancelled

    Definition Classes
    Exchange
  7. final def cancelSubscriptions(id: worker.SubscriptionKey, theRest: worker.SubscriptionKey*): Future[CancelSubscriptionsResponse]

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

    Permalink
    Definition Classes
    Exchange
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  10. def enqueue[T, Out](request: T, overrideDetails: SubmissionDetails)(implicit submitable: Submitable[T], asClient: AsClient[T, Out], ec: ExecutionContext): Future[Out]

    Permalink

    Enqueues a job w/ the overriding details (instead of the ones from the submitting in scope)

    Enqueues a job w/ the overriding details (instead of the ones from the submitting in scope)

    returns

    the single result

    Definition Classes
    JobSyntax
  11. def enqueue[T, Out](request: T)(implicit submitable: Submitable[T], asClient: AsClient[T, Out], ec: ExecutionContext): Future[Out]

    Permalink

    'enqueue' is a convenience method which will then make a request against the matched worker and return that result.

    'enqueue' is a convenience method which will then make a request against the matched worker and return that result.

    Note: It is assumed that the 'enqueue' is used against a job w/ SubmissionDetails which specify only a single worker is chosen. If a mode is provided which returns multiple workers, then 'enqueueAll' is your darling.

    Out

    the result type of the AsClient

    returns

    the result from the single asClient worker

    Definition Classes
    JobSyntax
  12. def enqueueAll[T, Out](request: T)(implicit submitable: Submitable[T], asClient: AsClient[T, Out], ec: ExecutionContext): Future[List[Future[Out]]]

    Permalink

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

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

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

    Out

    the response of the AsClient 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
    JobSyntax
  13. def enqueueJob[T, Out](value: T, job: SubmitJob)(implicit asClient: AsClient[T, Out], ec: ExecutionContext): Future[List[Future[Out]]]

    Permalink

    eventually we'll get a collection of all the response futures (hence Future[List[Future]])

    eventually we'll get a collection of all the response futures (hence Future[List[Future]])

    returns

    an eventual collection of all the response futures

    Definition Classes
    JobSyntax
  14. def enqueueSingleJob[T, Out](request: T, job: SubmitJob)(implicit asClient: AsClient[T, Out], ec: ExecutionContext): Future[Out]

    Permalink

    Syntax for submitting a job which will either return the first completed or

    Syntax for submitting a job which will either return the first completed or

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

    Permalink
    Definition Classes
    AnyRef
  16. def exchange: Exchange

    Permalink
    Attributes
    protected
    Definition Classes
    ExchangeJobSyntax
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    StrictLogging
  20. final def ne(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  23. val observer: MatchObserver

    Permalink
  24. def onClientRequest(request: ClientRequest): Future[ClientResponse]

    Permalink

    A convenience method where client requests can be sent through this single function which delegates to the appropriate method.

    A convenience method where client requests can be sent through this single function which delegates to the appropriate method. The 'convenience' in this sense is in terms of pluggability into message handling systems such as actor systems, REST endpoints, etc.

    returns

    the ClientResponse

    Definition Classes
    ServerSideExchangeExchange
  25. def onSubscriptionRequest(req: SubscriptionRequest): Future[SubscriptionResponse]

    Permalink

    A convenience method where subscription requests can be sent through this single function which delegates to the appropriate method.

    A convenience method where subscription requests can be sent through this single function which delegates to the appropriate method. The 'convenience' in this sense is in terms of pluggability into message handling systems such as actor systems, REST endpoints, etc.

    returns

    the SubscriptionResponse

    Definition Classes
    ServerSideExchangeExchange
  26. def queueState(request: QueueState = QueueState()): Future[QueueStateResponse]

    Permalink

    Queue the state of the exchange

    Queue the state of the exchange

    returns

    the current queue state

    Definition Classes
    Exchange
  27. def submit(req: SubmitJob): Future[ClientResponse]

    Permalink

    Submit a job to the exchange and trigger a match for work.

    Submit a job to the exchange and trigger a match for work.

    If 'awaitMatch' is specified on the SubmitJob then the response will be a BlockingSubmitJobResponse. Otherwise it will just be sent to the exchange an immediately return a SubmitJobResponse.

    If the submitted job already contains a jobId, then that id will be used and any existing submission with the same Id will be replaced.

    req

    the job request

    returns

    either BlockingSubmitJobResponse or a SubmitJobResponse

    Definition Classes
    ServerSideExchangeExchange
  28. def submitJobAndAwaitMatch(submitJob: SubmitJob)(implicit submitCtxt: ExecutionContext): Future[BlockingSubmitJobResponse]

    Permalink

    Submits the job to the exchange and blocks until there's a match

    Submits the job to the exchange and blocks until there's a match

    returns

    a future BlockSubmitJobResponse

  29. def subscribe(request: WorkSubscription, initialRequest: Int)(implicit ec: ExecutionContext): Future[(WorkSubscriptionAck, RequestWorkAck)]

    Permalink

    Convenience method to subscribe and immediately request work items

    Convenience method to subscribe and immediately request work items

    request

    the work subscription

    initialRequest

    the number of work items to request

    ec

    the execution context

    returns

    a tuple of the subscribe ack and request ack

    Definition Classes
    Exchange
  30. def subscribe(request: WorkSubscription): Future[WorkSubscriptionAck]

    Permalink

    Creates or updates a WorkSubscription, whose returned WorkSubscriptionAck key can be used to pull work items from the exchange.

    Creates or updates a WorkSubscription, whose returned WorkSubscriptionAck key can be used to pull work items from the exchange.

    If the request specifies a subscription key then any existing subscription with the given id will be updated by having its work details combined w/ the existing subscription

    If no subscription key is supplied, then a new one will be generated and provided on the ack.

    request

    the work subscription

    returns

    an ack containing the key needed to request work items

    Definition Classes
    Exchange
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. final def take(id: worker.SubscriptionKey, itemsRequested: Int): Future[RequestWorkAck]

    Permalink

    convenience method for pulling work items

    convenience method for pulling work items

    Definition Classes
    Exchange
  33. def take(request: RequestWork): Future[RequestWorkAck]

    Permalink

    request

    the number of work items to request

    returns

    an ack which contains the current known total items requested

    Definition Classes
    Exchange
  34. val underlying: Exchange

    Permalink
  35. def updateSubscriptionDetails(update: UpdateSubscription): Future[UpdateSubscriptionAck]

    Permalink

    Updates the json subscription details referred to by the subscription key.

    Updates the json subscription details referred to by the subscription key.

    Definition Classes
    Exchange
    See also

    UpdateSubscription for comments

  36. final def wait(): Unit

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

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

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

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Exchange

Inherited from JobSyntax

Inherited from StrictLogging

Inherited from AnyRef

Inherited from Any

Ungrouped