colossus.service

ServiceClient

class ServiceClient[P <: Protocol] extends ControllerDownstream[controller.Encoding.Client[P]] with HasUpstream[ControllerUpstream[controller.Encoding.Client[P]]] with Sender[P, Callback] with HandlerTail

A ServiceClient is a non-blocking, synchronous interface that handles sending atomic commands on a connection and parsing their replies

Notice - The client will not begin to connect until it is bound to a worker, so when using the default constructor a service client will not connect on it's own. You must either call bind on the client or use the constructor that accepts a worker

TODO: make underlying output controller data size configurable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ServiceClient
  2. HandlerTail
  3. UpstreamEvents
  4. Sender
  5. ControllerDownstream
  6. DownstreamEvents
  7. WorkerItemEvents
  8. HasUpstream
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ServiceClient(codec: controller.Codec.Client[P], config: ClientConfig, worker: WorkerRef)

  2. new ServiceClient(codec: controller.Codec.Client[P], config: ClientConfig, context: Context)(implicit tagDecorator: TagDecorator[P] = TagDecorator.default[P])

Type Members

  1. type Request = P.Request

  2. type Response = P.Response

  3. type ResponseHandler = (Try[Response]) ⇒ Unit

  4. class SourcedRequest extends AnyRef

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def bind(): Unit

    Definition Classes
    DownstreamEvents
  8. def canSend: Boolean

    returns true if the client is potentially able to send.

    returns true if the client is potentially able to send. This does not necessarily mean any new requests will actually be sent, but rather that the client will make an attempt to send it. This returns false when the client either failed to connect (including retries) or when it has been shut down.

  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val codec: controller.Codec.Client[P]

  11. val config: ClientConfig

  12. def connected(): Unit

    Definition Classes
    ServiceClientDownstreamEvents
  13. def connectionClosed(cause: DisconnectCause): Unit

    Attributes
    protected
  14. def connectionLost(cause: DisconnectError): Unit

    Attributes
    protected
  15. def connectionState: ConnectionState

  16. def connectionStatus: ConnectionStatus

  17. def connectionTerminated(reason: DisconnectCause): Unit

    Definition Classes
    DownstreamEvents
  18. val context: Context

    Definition Classes
    ServiceClientDownstreamEvents
  19. val controllerConfig: ControllerConfig

    Definition Classes
    ServiceClientControllerDownstream
  20. def disconnect(): Unit

    Definition Classes
    ServiceClientSender
  21. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def fullHandler(me: ServiceClient[P]): ClientConnectionHandler

    Attributes
    protected
  25. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  27. def id: Long

  28. def idleCheck(period: FiniteDuration): Unit

    Definition Classes
    DownstreamEvents
  29. val incoming: BufferedPipe[Response]

    Definition Classes
    ServiceClientControllerDownstream
  30. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  31. lazy val log: LoggingAdapter

  32. implicit val namespace: MetricContext

  33. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  36. def onBind(): Unit

    Called when the item is bound to a worker.

    Called when the item is bound to a worker.

    Definition Classes
    ServiceClientWorkerItemEvents
  37. def onConnected(): Unit

    Attributes
    protected
    Definition Classes
    DownstreamEvents
  38. def onConnectionTerminated(reason: DisconnectCause): Unit

    Attributes
    protected
    Definition Classes
    ServiceClientDownstreamEvents
  39. def onFatalError(reason: Throwable): Option[(controller.Encoding.Client[P])#Output]

    Definition Classes
    ControllerDownstream
  40. def onIdleCheck(period: FiniteDuration): Unit

    Attributes
    protected
    Definition Classes
    ServiceClientDownstreamEvents
  41. def onReceivedMessage(sender: ActorRef, message: Any): Unit

    Attributes
    protected
    Definition Classes
    DownstreamEvents
  42. def onShutdown(): Unit

    Attributes
    protected
    Definition Classes
    UpstreamEvents
  43. def onUnbind(): Unit

    Called when the item has been unbound from a worker

    Called when the item has been unbound from a worker

    Attributes
    protected
    Definition Classes
    WorkerItemEvents
  44. def processMessages(): Unit

  45. def receivedMessage(message: Any, sender: ActorRef): Unit

    Provides a way to send this WorkerItem a message from an Actor by way of WorkerCommand.

    Provides a way to send this WorkerItem a message from an Actor by way of WorkerCommand.Message.

    message

    The message that was sent

    sender

    The sender who sent the message

    Definition Classes
    DownstreamEventsWorkerItemEvents
  46. def send(request: Request): Callback[P.Response]

    Create a callback for sending a request.

    Create a callback for sending a request. this allows you to do something like service.send("request"){response => "YAY"}.map{str => println(str)}.execute()

    Definition Classes
    ServiceClientSender
  47. def setUpstream(up: ControllerUpstream[controller.Encoding.Client[P]]): Unit

    Definition Classes
    HasUpstream
  48. def shutdown(): Unit

    Definition Classes
    ServiceClientUpstreamEvents
  49. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  50. def toString(): String

    Definition Classes
    AnyRef → Any
  51. def unbind(): Unit

    Definition Classes
    DownstreamEvents
  52. lazy val upstream: ControllerUpstream[controller.Encoding.Client[P]]

    Definition Classes
    HasUpstream
  53. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from HandlerTail

Inherited from UpstreamEvents

Inherited from Sender[P, Callback]

Inherited from DownstreamEvents

Inherited from WorkerItemEvents

Inherited from AnyRef

Inherited from Any

Ungrouped