Class

colossus.service

ServiceClient

Related Doc: package service

Permalink

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

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. ColossusLogging
  3. HandlerTail
  4. UpstreamEvents
  5. Client
  6. Sender
  7. ControllerDownstream
  8. DownstreamEvents
  9. WorkerItemEvents
  10. HasUpstream
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ServiceClient(address: InetSocketAddress, config: ClientConfig, context: Context)(implicit tagDecorator: TagDecorator[P] = TagDecorator.default[P])

    Permalink

Type Members

  1. type Request = P.Request

    Permalink
  2. type Response = P.Response

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

    Permalink
  4. class SourcedRequest extends AnyRef

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addInterceptor(interceptor: Interceptor[P]): Unit

    Permalink
    Definition Classes
    ServiceClientSender
  5. val address: InetSocketAddress

    Permalink
    Definition Classes
    ServiceClientSender
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def bind(): Unit

    Permalink
    Definition Classes
    DownstreamEvents
  8. def canSend: Boolean

    Permalink

    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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val config: ClientConfig

    Permalink
  11. def connected(): Unit

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

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

    Permalink
    Attributes
    protected
  14. def connectionState: ConnectionState

    Permalink
  15. def connectionStatus: Callback[ConnectionStatus]

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

    Permalink
    Definition Classes
    DownstreamEvents
  17. val context: Context

    Permalink
    Definition Classes
    ServiceClientDownstreamEvents
  18. val controllerConfig: ControllerConfig

    Permalink
    Definition Classes
    ServiceClientControllerDownstream
  19. def debug(s: ⇒ String): Unit

    Permalink
    Definition Classes
    ColossusLogging
  20. def disconnect(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. def error(s: ⇒ String, t: Throwable): Unit

    Permalink
    Definition Classes
    ColossusLogging
  24. def error(s: ⇒ String): Unit

    Permalink
    Definition Classes
    ColossusLogging
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def formatIterable(iterable: Iterable[Any], size: Int): String

    Permalink
    Definition Classes
    ColossusLogging
  27. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  29. def id: Long

    Permalink
  30. def idleCheck(period: FiniteDuration): Unit

    Permalink
    Definition Classes
    DownstreamEvents
  31. val incoming: BufferedPipe[Response]

    Permalink
    Definition Classes
    ServiceClientControllerDownstream
  32. def info(s: ⇒ String): Unit

    Permalink
    Definition Classes
    ColossusLogging
  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. lazy val log: LoggingAdapter

    Permalink
  35. implicit val namespace: MetricContext

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

    Permalink
    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. def onBind(): Unit

    Permalink

    Called when the item is bound to a worker.

    Called when the item is bound to a worker.

    Definition Classes
    ServiceClientWorkerItemEvents
  40. def onConnected(): Unit

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

    Permalink
    Attributes
    protected
    Definition Classes
    ServiceClientDownstreamEvents
  42. def onFatalError(reason: Throwable): Terminate.type

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

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

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

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

    Permalink

    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
  47. def processMessages(): Unit

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

    Permalink

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

    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
  49. def send(request: Request): Callback[P.Response]

    Permalink

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

    Permalink
    Definition Classes
    HasUpstream
  51. def shutdown(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  53. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  54. def trace(s: ⇒ String): Unit

    Permalink
    Definition Classes
    ColossusLogging
  55. def unbind(): Unit

    Permalink
    Definition Classes
    DownstreamEvents
  56. def update(addresses: Seq[InetSocketAddress]): Unit

    Permalink
    Definition Classes
    ServiceClientSender
  57. lazy val upstream: ControllerUpstream[controller.Encoding.Client[P]]

    Permalink
    Definition Classes
    HasUpstream
  58. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. def warn(s: ⇒ String): Unit

    Permalink
    Definition Classes
    ColossusLogging

Inherited from ColossusLogging

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