mot

Client

Related Doc: package mot

final class Client extends MotParty with StrictLogging

Mot client. Instantiate this class to create a client-side Mot protocol engine.

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

Instance Constructors

  1. new Client(context: Context, name: String, maxLength: Int = 100000, maxQueueSize: Int = 1000, readBufferSize: Int = 10000, writeBufferSize: Int = 5000, connectorGc: FiniteDuration = Duration(600, TimeUnit.SECONDS), tolerance: Duration = Duration.Inf)

    Create a new Mot client.

    Create a new Mot client.

    context

    Context in which this client will be registered.

    name

    Name of this client. Must be unique in the context and will be reported to the servers.

    maxLength

    Maximum allowable response length, in bytes, this length is informed to the server. Connections that send messages longer than the maximum are dropped to a simple DOS attack with larger-than-allowed messages.

    maxQueueSize

    Maximum length (in messages) of the sending queue size. Too big a value uses too much memory, too little can degrade latency as the queue is empty too much time. There is one queue per counterpart.

    readBufferSize

    Size (in bytes) of the reader buffer

    writeBufferSize

    Size (in bytes) of the writer buffer

    connectorGc

    Time after which an idle connection will be closed.

    tolerance

    Time after which a client stop accepting messages if the connection cannot be established. Mot can accept (and enqueue) messages even if the underlying connection failed or cannot be created. Setting the tolerance to a lower value improves error detection, at the expense of not taking advantage of intermittent connections. Setting it to a higher value (or infinite) marked the interface more resilient, at the expense of not reporting connection errors until the requests time out.

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. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def close(): Unit

    Close the client.

    Close the client. Calling this method terminates all threads and connections.

  7. val connectorGc: FiniteDuration

    Time after which an idle connection will be closed.

  8. val context: Context

    Context in which this client will be registered.

    Context in which this client will be registered.

    Definition Classes
    ClientMotParty
  9. def createFlow(): ClientFlow

    Create a client flow.

    Create a client flow. Objects created using this method can be associated to outgoing messages and after that used for response flow control.

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

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

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

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

    Definition Classes
    AnyRef → Any
  14. def getResponse(target: Address, message: Message, timeoutMs: Int, flow: ClientFlow = mainFlow): Message

    Send a request and block until the response arrives or the timeout expires.

  15. def hashCode(): Int

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

    Definition Classes
    Any
  17. val logger: Logger

    Attributes
    protected
    Definition Classes
    StrictLogging → Logging
  18. val mainFlow: ClientFlow

    Main flow, always created and used as default when no flow is specified.

    Main flow, always created and used as default when no flow is specified. Opening and closing the mainFlow is possible but not recommended.

  19. val maxLength: Int

    Maximum allowable response length, in bytes, this length is informed to the server.

    Maximum allowable response length, in bytes, this length is informed to the server. Connections that send messages longer than the maximum are dropped to a simple DOS attack with larger-than-allowed messages.

    Definition Classes
    ClientMotParty
  20. val maxQueueSize: Int

    Maximum length (in messages) of the sending queue size.

    Maximum length (in messages) of the sending queue size. Too big a value uses too much memory, too little can degrade latency as the queue is empty too much time. There is one queue per counterpart.

  21. val name: String

    Name of this client.

    Name of this client. Must be unique in the context and will be reported to the servers.

    Definition Classes
    ClientMotParty
  22. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  25. def offerMessage(target: Address, message: Message): Boolean

    Offer an unrespondible message.

    Offer an unrespondible message.

    target

    Message destination.

    message

    Message to send.

  26. def offerMessage(target: Address, message: Message, enqueingTimeout: Long, enqueingTimeoutUnit: TimeUnit): Boolean

    Offer an unrespondible message.

    Offer an unrespondible message. This method overload allows to specify whether (and how much time) to block waiting for space in the sending queue.

    target

    Message destination.

    message

    Message to send.

    enqueingTimeout

    How much time to wait for the enqueuing of the message. The queue will be fill if the server is not reading requests fast enough. This has nothing to to with the time the server takes to respond, but it would be possible that an server with too many pending responses choose to stop reading new requests. A non-blocking client would use a zero timeout here, in combination with a large enough queue (in order to be able to keep pace with transitory differences in velocities).

    enqueingTimeoutUnit

    Unit of the enqueingTimeout

    returns

    true if the message could be enqueued, false otherwise

  27. def offerRequest(target: Address, message: Message, timeoutMs: Int, promise: Promise[IncomingResponse]): Boolean

    Offer a request.

    Offer a request. When the response arrives, complete the promise passed as an argument.

    target

    Message destination.

    message

    Message to send.

    timeoutMs

    How much to wait for the response, in milliseconds.

    promise

    A promise that will receive the response when it arrives (or will receive the error). mot.util.UnaryPromise provides a convenient one-value promise for simple cases.

  28. def offerRequest(target: Address, message: Message, timeoutMs: Int, promise: Promise[IncomingResponse], enqueingTimeout: Long, enqueingTimeoutUnit: TimeUnit): Boolean

    Offer a request.

    Offer a request. When the response arrives, complete the promise passed as an argument. This method overload allows to specify whether (and how much time) to block waiting for space in the sending queue.

    target

    Message destination.

    message

    Message to send.

    timeoutMs

    How much to wait for the response, in milliseconds.

    promise

    A promise that will receive the response when it arrives (or will receive the error). mot.util.UnaryPromise provides a convenient one-value promise for simple cases.

    enqueingTimeout

    How much time to wait for the enqueuing of the message. The queue will be fill if the server is not reading requests fast enough. This has nothing to to with the time the server takes to respond, but it would be possible that an server with too many pending responses choose to stop reading new requests. A non-blocking client would use a zero timeout here, in combination with a large enough queue (in order to be able to keep pace with transitory differences in velocities).

    enqueingTimeoutUnit

    Unit of the enqueingTimeout

  29. def offerRequest(target: Address, message: Message, timeoutMs: Int, promise: Promise[IncomingResponse], flow: ClientFlow): Boolean

    Offer a request.

    Offer a request. When the response arrives, complete the promise passed as an argument. This method overload allows to specify a flow to use.

    target

    Message destination.

    message

    Message to send.

    timeoutMs

    How much to wait for the response, in milliseconds.

    promise

    A promise that will receive the response when it arrives (or will receive the error). mot.util.UnaryPromise provides a convenient one-value promise for simple cases.

    flow

    A flow to associate with this message, this can be latter used to control the arrival of responses.

    returns

    Whether the message could be enqueued or the corresponding queue overflowed.

  30. def offerRequest(target: Address, message: Message, timeoutMs: Int, promise: Promise[IncomingResponse], flow: ClientFlow, enqueingTimeout: Long, enqueingTimeoutUnit: TimeUnit): Boolean

    Offer a request.

    Offer a request. When the response arrives, complete the promise passed as an argument. This method overload allows to specify a flow to use and whether (and how much time) to block waiting for space in the sending queue.

    target

    Message destination.

    message

    Message to send.

    timeoutMs

    How much to wait for the response, in milliseconds.

    promise

    A promise that will receive the response when it arrives (or will receive the error). mot.util.UnaryPromise provides a convenient one-value promise for simple cases.

    flow

    A flow to associate with this message, this can be latter used to control the arrival of responses.

    enqueingTimeout

    How much time to wait for the enqueuing of the message. The queue will be fill if the server is not reading requests fast enough. This has nothing to to with the time the server takes to respond, but it would be possible that an server with too many pending responses choose to stop reading new requests. A non-blocking client would use a zero timeout here, in combination with a large enough queue (in order to be able to keep pace with transitory differences in velocities).

    enqueingTimeoutUnit

    Unit of the enqueingTimeout

    returns

    Whether the message could be enqueued or the corresponding queue overflowed.

  31. val readBufferSize: Int

    Size (in bytes) of the reader buffer

    Size (in bytes) of the reader buffer

    Definition Classes
    ClientMotParty
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    Client → AnyRef → Any
  34. val tolerance: Duration

    Time after which a client stop accepting messages if the connection cannot be established.

    Time after which a client stop accepting messages if the connection cannot be established. Mot can accept (and enqueue) messages even if the underlying connection failed or cannot be created. Setting the tolerance to a lower value improves error detection, at the expense of not taking advantage of intermittent connections. Setting it to a higher value (or infinite) marked the interface more resilient, at the expense of not reporting connection errors until the requests time out.

  35. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. val writeBufferSize: Int

    Size (in bytes) of the writer buffer

    Size (in bytes) of the writer buffer

    Definition Classes
    ClientMotParty

Inherited from StrictLogging

Inherited from Logging

Inherited from MotParty

Inherited from AnyRef

Inherited from Any

Ungrouped