Trait

agora.rest.worker

RouteSubscriptionSupport

Related Doc: package worker

Permalink

trait RouteSubscriptionSupport extends LazyLogging

The 'RouteSubscriptionSupport' exposes a directive exists to integrate existing routes with an Exchange.

Consider some basic route:

post(path("foo")) { ... }

We want to be able to integrate it with an exchange to make it a reactive, work-pulling route. We also want that to be non-intrusive. A client of our basic route shouldn't be forced to go via the Exchange to use our endpoint; it should work the same with or without the exchange.

To accomplish this, we'll need to know: 1) The exchange from which to pull more work 2) the subscription key used to request the next work item 3) a means to identify whether the given request was made as a result of a match on the exchange (as opposed to just being hit directly) 4) to know when the response is complete

Linear Supertypes
LazyLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RouteSubscriptionSupport
  2. LazyLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class SetPendingTarget(optimal: Int) extends TakeAction with Product with Serializable

    Permalink

    Tries subscribe to the 'optimal' requests.

    Tries subscribe to the 'optimal' requests. So if we handle a request which tells us there are 3 items remaining and 'optimal' is set to 10, then a 'take' request is made for 7 work items.

    If 'optimal' is less than the items remaining then no action is performed.

  2. sealed trait TakeAction extends AnyRef

    Permalink

    Represents how many work items will be requested upon request completion

    Represents how many work items will be requested upon request completion

    Attributes
    protected

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. object ReplaceOne extends TakeAction with Product with Serializable

    Permalink

    This is the default case -- just request one work item (e.g.

    This is the default case -- just request one work item (e.g. one in, one out semantics)

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  9. def extractMatchDetails: Directive1[Option[MatchDetails]]

    Permalink
  10. def finalize(): Unit

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

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

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

    Permalink
    Definition Classes
    Any
  14. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  15. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  18. def requestIsFromExchange(originalRequest: HttpRequest): Boolean

    Permalink
  19. def requestOnComplete(matchDetails: MatchDetails, exchange: Exchange, action: TakeAction = ReplaceOne): Directive0

    Permalink
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def takeNext(matchDetails: MatchDetails, exchange: Exchange, action: TakeAction = ReplaceOne): Any

    Permalink
  22. def takeNextOnComplete(exchange: Exchange, action: TakeAction = ReplaceOne): Directive[Unit]

    Permalink

    A directive which will ask the exchange for another work item if the request was sent in response to an exchange match (e.g.

    A directive which will ask the exchange for another work item if the request was sent in response to an exchange match (e.g. it contains the exchanger headers).

    The subscription key used for the exchange will be taken from the MatchDetails taken from the request. If there are no MatchDetails then 'takeNextOnComplete' will have no effect

    exchange

    the exchange from which the work is pulled

    action

    how many items should be requested on complete? Defaults to just replacing one work item

    returns

    a directive yo

  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

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

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

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

Inherited from LazyLogging

Inherited from AnyRef

Inherited from Any

Ungrouped