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, requestEnhancement: (P.Request, Sender[P, Callback]) ⇒ P.Request)(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. val address: InetSocketAddress

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

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

    Permalink
    Definition Classes
    DownstreamEvents
  7. 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.

  8. def clone(): AnyRef

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

    Permalink
  10. def connected(): Unit

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

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

    Permalink
    Attributes
    protected
  13. def connectionState: ConnectionState

    Permalink
  14. def connectionStatus: Callback[ConnectionStatus]

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

    Permalink
    Definition Classes
    DownstreamEvents
  16. val context: Context

    Permalink
    Definition Classes
    ServiceClientDownstreamEvents
  17. val controllerConfig: ControllerConfig

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  33. lazy val log: LoggingAdapter

    Permalink
  34. implicit val namespace: MetricContext

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

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

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

    Permalink
    Definition Classes
    AnyRef
  38. 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
  39. def onConnected(): Unit

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. 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