Trait

curiodb

PubSubClient

Related Doc: package curiodb

Permalink

trait PubSubClient extends CommandProcessing

PubSubClient is exclusively part of ClientNode, but defined separately here for clarity. A ClientNode is responsible for managing a single client connection, and PubSubClient is required to store a set of channels and patterns its subscribed to, similar to the way PubSubServer maps these to ClientNode ActorRef instances.

Linear Supertypes
CommandProcessing, Actor, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PubSubClient
  2. CommandProcessing
  3. Actor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. type CommandRunner = PartialFunction[String, Any]

    Permalink

    Signature for the partial function CommandRunner that actually handles each command.

    Signature for the partial function CommandRunner that actually handles each command. Every Node must implement the "run" method of this type (this requirement is actually codified in the base Node class). It takes a case statement mapping command names to the code that handles them - typically handled inline, or via a method if more complex. The result will then be sent back to the calling ClientNode, and converted into a Redis response before being sent back to the client socket. One special case is the handler returning Unit, in which case no response is sent back, in which case it's up to the handling code to manually send a response back to the client node. A common example of this is all of the aggregation commands, which need to coordinate with multiple nodes before calculating a response. But the bulk of commands are simple one-liners directly returning a response.

    Definition Classes
    CommandProcessing
  2. type Receive = PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    Actor

Abstract Value Members

  1. abstract def receive: akka.actor.Actor.Receive

    Permalink
    Definition Classes
    Actor

Concrete 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 aggregate(props: Props): Unit

    Permalink

    Shortcut for creating Aggregate actors.

    Shortcut for creating Aggregate actors.

    Definition Classes
    CommandProcessing
  5. def args: Seq[String]

    Permalink

    Shortcut to the args of the current command.

    Shortcut to the args of the current command.

    Definition Classes
    CommandProcessing
  6. def aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  7. def aroundPostStop(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  8. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  9. def aroundPreStart(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  10. def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. def bounds(from: Int, to: Int, size: Int): (Int, Int)

    Permalink

    Utility for handling boundary args that wrap around ends of sequences and count backwards when negative.

    Utility for handling boundary args that wrap around ends of sequences and count backwards when negative.

    Definition Classes
    CommandProcessing
  13. lazy val channels: Set[String]

    Permalink

    Channels subscribed to.

  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. var command: Command

    Permalink

    The current command - normally will be set when a Command arrives via the actor's receive method.

    The current command - normally will be set when a Command arrives via the actor's receive method.

    Definition Classes
    CommandProcessing
  16. val commandTimeout: Int

    Permalink

    Timeout for a single command.

    Timeout for a single command. Used by ClientNode to schedule timeout handlers for commands, and also in ScriptRunner to determine what the timeout for a Lua script should be.

    Definition Classes
    CommandProcessing
  17. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  18. val debug: Boolean

    Permalink

    Flag that enables detailed command debugging.

    Flag that enables detailed command debugging.

    Definition Classes
    CommandProcessing
  19. def durationSetting(name: String): Int

    Permalink

    Retrieves a duration config setting as milliseconds, and handles the value not being a duration value, so we can do something like set it to "off", in which case we default to 0.

    Retrieves a duration config setting as milliseconds, and handles the value not being a duration value, so we can do something like set it to "off", in which case we default to 0.

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

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  26. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  29. def numberToString(n: Any): String

    Permalink

    Utility for dropping extraneous zeros from floats when converting to strings, for consistency with Redis' INCRBYFLOAT/HINCRBYFLOAT commands and sorted set scores.

    Utility for dropping extraneous zeros from floats when converting to strings, for consistency with Redis' INCRBYFLOAT/HINCRBYFLOAT commands and sorted set scores.

    Definition Classes
    CommandProcessing
  30. def pattern(values: Iterable[String], pattern: String): Iterable[String]

    Permalink

    Utility for glob-style filtering.

    Utility for glob-style filtering.

    Definition Classes
    CommandProcessing
  31. lazy val patterns: Set[String]

    Permalink

    Patterns subscribed to.

  32. def postRestart(reason: Throwable): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  33. def postStop(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  34. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  35. def preStart(): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  36. def randomItem(iterable: Iterable[String]): String

    Permalink

    Utility for selecting a random item.

    Utility for selecting a random item.

    Definition Classes
    CommandProcessing
  37. def receivePubSub: Receive

    Permalink

    Receive for PubSubClient, which is given a distinct name, so that ClientNode can compose together multiple Receive methods to form its own.

    Receive for PubSubClient, which is given a distinct name, so that ClientNode can compose together multiple Receive methods to form its own. Here we provide handling for PubSubEvent messages, which allow us to inform the client of the number of subscriptions it holds when subscribing or unsubscribing.

  38. def respond(response: Any): Unit

    Permalink

    Sends a Response (usually the result of a command) back to the command's destination (usually a ClientNode sending a Command).

    Sends a Response (usually the result of a command) back to the command's destination (usually a ClientNode sending a Command).

    Definition Classes
    CommandProcessing
  39. def route(input: Seq[Any], client: Option[ActorRef] = None): Unit

    Permalink

    Shortcut route method for sending command input without a constructed Command instance, using the state of the current command (eg: db, clientID).

    Shortcut route method for sending command input without a constructed Command instance, using the state of the current command (eg: db, clientID).

    Definition Classes
    CommandProcessing
  40. def route(command: Command): Unit

    Permalink

    Sends an unrouted Command to one or more KeyNode actors, either by routing by key, or broadcasting to all.

    Sends an unrouted Command to one or more KeyNode actors, either by routing by key, or broadcasting to all.

    Definition Classes
    CommandProcessing
  41. def runPubSub: CommandRunner

    Permalink

    CommandRunner for PubSubClient, which is given a distinct name, so that ClientNode can compose together multiple CommandRunner methods to form its own.

  42. def scan(values: Iterable[String]): Seq[String]

    Permalink

    Utility for scan-style commands, namely SCAN/SSCAN/HSCAN/ZSCAN.

    Utility for scan-style commands, namely SCAN/SSCAN/HSCAN/ZSCAN.

    Definition Classes
    CommandProcessing
  43. implicit final val self: ActorRef

    Permalink
    Definition Classes
    Actor
  44. final def sender(): ActorRef

    Permalink
    Definition Classes
    Actor
  45. def slice[T](value: Seq[T]): Seq[T]

    Permalink

    Utility for slicing sequences, for commands such as SLICE, GETRANGE, LRANGE, etc.

    Utility for slicing sequences, for commands such as SLICE, GETRANGE, LRANGE, etc.

    Definition Classes
    CommandProcessing
  46. def stop(): Unit

    Permalink

    Here we override the stop method used by CommandProcessing, which allows us to inform the KeyNode actors holding subscriptions to our channels and patterns that we're unsubscribing.

    Here we override the stop method used by CommandProcessing, which allows us to inform the KeyNode actors holding subscriptions to our channels and patterns that we're unsubscribing.

    Definition Classes
    PubSubClientCommandProcessing
  47. def subscribeOrUnsubscribe(): Unit

    Permalink

    Handles all commands that subscribe or unsubsubscribe, namely SUBSCRIBE/UNSUBSCRIBE/PSUBSCRIBE/PUNSUBSCRIBE.

  48. def supervisorStrategy: SupervisorStrategy

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  51. def unhandled(message: Any): Unit

    Permalink
    Definition Classes
    Actor
  52. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CommandProcessing

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped