mot

ClientFlow

Related Doc: package mot

final class ClientFlow extends StrictLogging

A "client flow" is an abstraction created to enable selective flow control, which is a way to ask the server in the other side to stop sending responses of a certain kind. The need for selective flow control comes when the client can receive back-pressure using some subset of the responses. Proxy servers are a prototypical case: when sending the responses to the front-end, some clients can slow down (the slowness can come from the themselves or from the network) and the proxy must either buffer the data, discard it, or tell the back-end to stop sending it.

If there is no need to be selective, there is no need of explicit flow control, as it is simpler to rely on TCP for that (not reading, and causing "zero window" notifications). This is the most common case.

Instances of this class are created by the Mot client, and are used opaquely: each request is associated with a flow (which defaults to the main flow). The client can then use the flows (of which it must keep references) to stop responses selectively: "closing" a flow instructs the server to do not send the responses of the messages that were associated with that particular flow. If flow control is not used, there is only one instance of this class, which is always created (the "main flow" with id 0).

This mechanism only applies to responses. Requests do not need it, as it is always possible to respond them with an application-level indication to stop. This is not the case with responses, which could only be discarded. (In the proxy case, additionally, it would be impossible for the front-end to know in advance which is the final target of a request).

It is also worth mentioning that no response is stopped half-sent: Mot is a small-message protocol and each message (that cannot use more than one frame) is always sent entirely o not at all.

See also

mot.protocol.FlowControlFrame

Linear Supertypes
StrictLogging, Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ClientFlow
  2. StrictLogging
  3. Logging
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. val client: Client

  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def closeFlow(): Boolean

    Close the flow.

    Close the flow. A frame is set telling the server in the other side to stop sending responses to the messages associated with this flow.

    returns

    true if the command succeeded (because the flow was open).

  8. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

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

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

    Definition Classes
    AnyRef → Any
  13. val id: Int

  14. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  15. def isOpen(): Boolean

    Return whether this flow is open.

  16. val logger: Logger

    Attributes
    protected
    Definition Classes
    StrictLogging → Logging
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def openFlow(): Boolean

    Open the flow.

    Open the flow. A frame is set telling the server in the other side to start sending responses to the messages associated with this flow again.

    returns

    true if the command succeeded (because the flow was closed).

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

    Definition Classes
    AnyRef
  22. def toString(): String

    Definition Classes
    ClientFlow → AnyRef → Any
  23. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StrictLogging

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped