scredis

SubscriberClient

class SubscriberClient extends SubscriberAkkaConnection with SubscriberCommands

Defines a Pub/Sub Redis client capable of subscribing to channels/patterns.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SubscriberClient
  2. SubscriberCommands
  3. SubscriberAkkaConnection
  4. SubscriberConnection
  5. AbstractAkkaConnection
  6. LazyLogging
  7. Logging
  8. Connection
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SubscriberClient(configName: String, path: String)(implicit system: ActorSystem)

    Constructs a scredis.SubscriberClient instance from a config file and using the provided path.

    Constructs a scredis.SubscriberClient instance from a config file and using the provided path.

    configName

    config filename

    path

    path pointing to the scredis config object

    returns

    the constructed scredis.SubscriberClient

    Note

    The path must include to the scredis object, e.g. x.y.scredis

  2. new SubscriberClient(configName: String)(implicit system: ActorSystem)

    Constructs a scredis.SubscriberClient instance from a config file.

    Constructs a scredis.SubscriberClient instance from a config file.

    configName

    config filename

    returns

    the constructed scredis.SubscriberClient

    Note

    The config file must contain the scredis object at its root. This constructor is equivalent to

    new Client(configName, "scredis")
  3. new SubscriberClient(config: Config)(implicit system: ActorSystem)

    Constructs a scredis.SubscriberClient instance from a com.typesafe.Config

    Constructs a scredis.SubscriberClient instance from a com.typesafe.Config

    config

    com.typesafe.Config

    returns

    the constructed scredis.SubscriberClient

    Note

    The config must contain the scredis object at its root. This constructor is equivalent to

    new Client(config, "scredis")
  4. new SubscriberClient(config: RedisConfig)(implicit system: ActorSystem)

    Constructs a scredis.SubscriberClient instance from a scredis.RedisConfig

    Constructs a scredis.SubscriberClient instance from a scredis.RedisConfig

    config

    scredis.RedisConfig

    returns

    the constructed scredis.SubscriberClient

  5. new SubscriberClient(host: String = RedisConfigDefaults.Redis.Host, port: Int = RedisConfigDefaults.Redis.Port, passwordOpt: Option[String] = ..., nameOpt: Option[String] = RedisConfigDefaults.Redis.NameOpt, connectTimeout: FiniteDuration = ..., receiveTimeoutOpt: Option[FiniteDuration] = ..., maxWriteBatchSize: Int = ..., tcpSendBufferSizeHint: Int = ..., tcpReceiveBufferSizeHint: Int = ..., akkaListenerDispatcherPath: String = ..., akkaIODispatcherPath: String = ..., akkaDecoderDispatcherPath: String = ...)(implicit system: ActorSystem)

    host

    server address

    port

    server port

    passwordOpt

    optional server password

    nameOpt

    optional client name (available since 2.6.9)

    connectTimeout

    connection timeout

    receiveTimeoutOpt

    optional batch receive timeout

    maxWriteBatchSize

    max number of bytes to send as part of a batch

    tcpSendBufferSizeHint

    size hint of the tcp send buffer, in bytes

    tcpReceiveBufferSizeHint

    size hint of the tcp receive buffer, in bytes

    akkaListenerDispatcherPath

    path to listener dispatcher definition

    akkaIODispatcherPath

    path to io dispatcher definition

    akkaDecoderDispatcherPath

    path to decoder dispatcher definition

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. val akkaDecoderDispatcherPath: String

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  5. val akkaIODispatcherPath: String

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  6. val akkaListenerDispatcherPath: String

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def auth(password: String): Future[Unit]

    Authenticates to the server.

    Authenticates to the server.

    password

    the server password

    Since

    1.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisErrorResponseException]]

    if authentication failed

    Note

    Use the empty string to re-authenticate with no password.

  9. def authenticate(password: String): Future[Unit]

    Attributes
    protected
    Definition Classes
    SubscriberAkkaConnection
  10. def awaitTermination(timeout: Duration = Duration.Inf): Unit

    Waits for all the internal actors to be shutdown.

    Waits for all the internal actors to be shutdown.

    timeout

    amount of time to wait

    Definition Classes
    AbstractAkkaConnection
    Note

    This method is usually called after issuing a QUIT command

  11. def clientSetName(name: String): Future[Unit]

    Sets the current client name.

    Sets the current client name. If the empty string is provided, the name will be unset.

    name

    name to associate the client to, if empty, unsets the client name

    Since

    2.6.9

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val connectTimeout: FiniteDuration

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  14. var database: Int

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  15. val decodersCount: Int

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  16. implicit val dispatcher: ExecutionContextExecutor

    Definition Classes
    AbstractAkkaConnectionConnection
  17. final def eq(arg0: AnyRef): Boolean

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

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

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

    Definition Classes
    AnyRef → Any
  21. def getDatabase: Int

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  22. def getNameOpt: Option[String]

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  23. def getPasswordOpt: Option[String]

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  24. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  25. val host: String

    Definition Classes
    AbstractAkkaConnection
  26. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  27. var isShuttingDown: Boolean

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  28. val listenerActor: ActorRef

    Attributes
    protected
    Definition Classes
    SubscriberAkkaConnectionAbstractAkkaConnection
  29. lazy val logger: Logger

    Attributes
    protected
    Definition Classes
    LazyLogging → Logging
  30. val maxWriteBatchSize: Int

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  31. var nameOpt: Option[String]

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  32. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  35. def pSubscribe(patterns: String*)(subscription: Subscription): Future[Int]

    Listens for messages published to channels matching the given patterns.

    Listens for messages published to channels matching the given patterns.

    patterns

    the patterns

    subscription

    partial function handling received messages

    returns

    the total number of subscribed channels and patterns

    Definition Classes
    SubscriberCommands
    Since

    2.0.0

    Note

    Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE and PUNSUBSCRIBE commands.

  36. def pUnsubscribe(patterns: String*): Future[Int]

    Stops listening for messages published to channels matching the given patterns.

    Stops listening for messages published to channels matching the given patterns.

    patterns

    the patterns, if empty, unsubscribe from all patterns

    returns

    the total number of subscribed channels and patterns

    Definition Classes
    SubscriberCommands
    Since

    2.0.0

    Note

    When no patterns are specified, the client is unsubscribed from all the previously subscribed patterns. In this case, a message for every unsubscribed pattern will be sent to the client.

  37. var passwordOpt: Option[String]

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  38. val port: Int

    Definition Classes
    AbstractAkkaConnection
  39. def quit(): Future[Unit]

    Unsubscribes from all subscribed channels/patterns and then closes the connection.

  40. val receiveTimeoutOpt: Option[FiniteDuration]

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  41. def sendAsSubscriber(request: Request[_]): Future[Int]

    Attributes
    protected
    Definition Classes
    SubscriberAkkaConnectionSubscriberConnection
  42. def setName(name: String): Future[Unit]

    Attributes
    protected
    Definition Classes
    SubscriberAkkaConnection
  43. def setSubscription(subscription: Subscription): Unit

    Attributes
    protected
    Definition Classes
    SubscriberAkkaConnectionSubscriberConnection
  44. def shutdown(): Future[Unit]

    Attributes
    protected
    Definition Classes
    SubscriberAkkaConnection
  45. def subscribe(channels: String*)(subscription: Subscription): Future[Int]

    Listens for messages published to the given channels.

    Listens for messages published to the given channels.

    channels

    channel name(s) of channel(s) to listen to

    subscription

    partial function handling received messages

    returns

    the total number of subscribed channels and patterns

    Definition Classes
    SubscriberCommands
    Since

    2.0.0

    Note

    Once the client enters the subscribed state it is not supposed to issue any other commands, except for additional SUBSCRIBE, PSUBSCRIBE, UNSUBSCRIBE and PUNSUBSCRIBE commands.

  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  47. val system: ActorSystem

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  48. val tcpReceiveBufferSizeHint: Int

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  49. val tcpSendBufferSizeHint: Int

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  50. def toString(): String

    Definition Classes
    AnyRef → Any
  51. def unsubscribe(channels: String*): Future[Int]

    Stops listening for messages published to the given channels.

    Stops listening for messages published to the given channels.

    channels

    the names of the channels, if empty, unsubscribe from all channels

    returns

    the total number of subscribed channels and patterns

    Definition Classes
    SubscriberCommands
    Since

    2.0.0

    Note

    When no channels are specified, the client is unsubscribed from all the previously subscribed channels. In this case, a message for every unsubscribed channel will be sent to the client.

  52. def updateState(request: Request[_]): Unit

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection
  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( ... )
  56. def watchTermination(): Unit

    Attributes
    protected
    Definition Classes
    AbstractAkkaConnection

Inherited from SubscriberCommands

Inherited from SubscriberAkkaConnection

Inherited from SubscriberConnection

Inherited from AbstractAkkaConnection

Inherited from LazyLogging

Inherited from Logging

Inherited from Connection

Inherited from AnyRef

Inherited from Any

Ungrouped