Packages

class ClientDispatcher extends GenSerialClientDispatcher[Request, Response, FrontendMessage, BackendMessage]

Handles transforming the Postgres protocol to an RPC style.

The Postgres protocol is not of the style request => Future[Response]. Instead, it uses a stateful protocol where each connection is in a particular state and streams of requests / responses take place to move the connection from one state to another.

The dispatcher is responsible for managing this connection state and transforming the stream of request / response to a single request / response style that conforms to Finagle's request / response style.

The dispatcher uses state machines to handle the connection state management.

When a connection is established, the HandshakeMachine is immediately executed and takes care of authentication. Subsequent machines to execute are based on the client's query. For example, if the client submits a Request.Query, then the SimpleQueryMachine will be dispatched to manage the connection's state.

Any unexpected error from the state machine will lead to tearing down the connection to make sure we don't reuse a connection in an unknown / bad state.

See also

StateMachine

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClientDispatcher
  2. GenSerialClientDispatcher
  3. Service
  4. Closable
  5. Function1
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ClientDispatcher(transport: Transport[FrontendMessage, BackendMessage], params: Params)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[A](g: (Future[Response]) => A): (Request) => A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  5. def apply(req: Request): Future[Response]

    This is the method to override/implement to create your own Service.

    This is the method to override/implement to create your own Service.

    Definition Classes
    ClientDispatcherGenSerialClientDispatcherService → Function1
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. def close(deadline: Time): Future[Unit]
    Definition Classes
    GenSerialClientDispatcherService → Closable
  9. def close(after: Duration): Future[Unit]
    Definition Classes
    Closable
  10. final def close(): Future[Unit]
    Definition Classes
    Closable
  11. def compose[A](g: (A) => Request): (A) => Future[Response]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  12. def dispatch(req: Request, p: Promise[Response]): Future[Unit]

    Dispatch a request, satisfying Promise p with the response; the returned Future is satisfied when the dispatch is complete: only one request is admitted at any given time.

    Dispatch a request, satisfying Promise p with the response; the returned Future is satisfied when the dispatch is complete: only one request is admitted at any given time.

    Note that GenSerialClientDispatcher manages interrupts, satisfying p should it be interrupted -- implementors beware: use only updateIfEmpty variants for satisfying the Promise.

    GenSerialClientDispatcher will also attempt to satisfy the promise if the returned Future[Unit] fails.

    Attributes
    protected
    Definition Classes
    ClientDispatcherGenSerialClientDispatcher
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isAvailable: Boolean

    Determines whether this Service is available (can accept requests with a reasonable likelihood of success).

    Determines whether this Service is available (can accept requests with a reasonable likelihood of success).

    Definition Classes
    Service
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def machineDispatch[R <: Response](machine: StateMachine[R], promise: Promise[R]): Future[Unit]
  21. def map[Req1](f: (Req1) => Request): Service[Req1, Response]
    Definition Classes
    Service
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. def status: Status

    The current availability Status of this Service.

    The current availability Status of this Service.

    Definition Classes
    GenSerialClientDispatcherService
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    Service → Function1 → AnyRef → Any
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Service[Request, Response]

Inherited from Closable

Inherited from (Request) => Future[Response]

Inherited from AnyRef

Inherited from Any

Ungrouped