colossus.service

ServiceClient

class ServiceClient[P <: Protocol] extends ControllerDownstream[controller.Encoding.Client[P]] with HasUpstream[ControllerUpstream[controller.Encoding.Client[P]]] with Client[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. Client
  5. Sender
  6. ControllerDownstream
  7. DownstreamEvents
  8. WorkerItemEvents
  9. HasUpstream
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ServiceClient(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 config: ClientConfig

  11. def connected(): Unit

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

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

    Attributes
    protected
  14. def connectionState: ConnectionState

  15. def connectionStatus: Callback[ConnectionStatus]

    Definition Classes
    ServiceClientClient
  16. def connectionTerminated(reason: DisconnectCause): Unit

    Definition Classes
    DownstreamEvents
  17. val context: Context

    Definition Classes
    ServiceClientDownstreamEvents
  18. val controllerConfig: ControllerConfig

    Definition Classes
    ServiceClientControllerDownstream
  19. def disconnect(): Unit

    Definition Classes
    ServiceClientClientSender
  20. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    AnyRef → Any
  25. def id: Long

  26. def idleCheck(period: FiniteDuration): Unit

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

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

    Definition Classes
    Any
  29. lazy val log: LoggingAdapter

  30. implicit val namespace: MetricContext

    Definition Classes
    ServiceClientControllerDownstream
  31. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  34. def onBind(): Unit

    Called when the item is bound to a worker.

    Called when the item is bound to a worker.

    Definition Classes
    ServiceClientWorkerItemEvents
  35. def onConnected(): Unit

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

    Attributes
    protected
    Definition Classes
    ServiceClientDownstreamEvents
  37. def onFatalError(reason: Throwable): None.type

    This method can be overriden to send a message in the event of a fatal error before the connection is closed.

    This method can be overriden to send a message in the event of a fatal error before the connection is closed. There is no guarantee though that the message is actually sent since the connection may have already closed.

    Definition Classes
    ServiceClientControllerDownstream
  38. def onIdleCheck(period: FiniteDuration): Unit

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

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

    Attributes
    protected
    Definition Classes
    UpstreamEvents
  41. 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
  42. def processMessages(): Unit

  43. 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
  44. 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
  45. def setUpstream(up: ControllerUpstream[controller.Encoding.Client[P]]): Unit

    Definition Classes
    HasUpstream
  46. def shutdown(): Unit

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

    Definition Classes
    AnyRef
  48. def toString(): String

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

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

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from HandlerTail

Inherited from UpstreamEvents

Inherited from Client[P, Callback]

Inherited from Sender[P, Callback]

Inherited from DownstreamEvents

Inherited from WorkerItemEvents

Inherited from AnyRef

Inherited from Any

Ungrouped