class SubscriberClient extends SubscriberAkkaConnection with SubscriberCommands
Defines a Pub/Sub Redis client capable of subscribing to channels/patterns.
- Alphabetic
- By Inheritance
- SubscriberClient
- SubscriberCommands
- SubscriberAkkaConnection
- SubscriberConnection
- AbstractAkkaConnection
- LazyLogging
- Connection
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- 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
- 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")
- 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")
- 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
- returns
the constructed scredis.SubscriberClient
- new SubscriberClient(host: String = RedisConfigDefaults.Redis.Host, port: Int = RedisConfigDefaults.Redis.Port, passwordOpt: Option[String] = RedisConfigDefaults.Redis.PasswordOpt, nameOpt: Option[String] = RedisConfigDefaults.Redis.NameOpt, connectTimeout: FiniteDuration = RedisConfigDefaults.IO.ConnectTimeout, receiveTimeoutOpt: Option[FiniteDuration] = RedisConfigDefaults.IO.ReceiveTimeoutOpt, maxWriteBatchSize: Int = RedisConfigDefaults.IO.MaxWriteBatchSize, tcpSendBufferSizeHint: Int = RedisConfigDefaults.IO.TCPSendBufferSizeHint, tcpReceiveBufferSizeHint: Int = RedisConfigDefaults.IO.TCPReceiveBufferSizeHint, akkaListenerDispatcherPath: String = RedisConfigDefaults.IO.Akka.ListenerDispatcherPath, akkaIODispatcherPath: String = RedisConfigDefaults.IO.Akka.IODispatcherPath, akkaDecoderDispatcherPath: String = RedisConfigDefaults.IO.Akka.DecoderDispatcherPath)(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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val akkaDecoderDispatcherPath: String
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val akkaIODispatcherPath: String
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val akkaListenerDispatcherPath: String
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- 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.
- def authenticate(password: String): Future[Unit]
- Attributes
- protected
- Definition Classes
- SubscriberAkkaConnection
- 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
- 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
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val connectTimeout: FiniteDuration
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- var database: Int
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val decodersCount: Int
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- implicit val dispatcher: ExecutionContextExecutor
- Definition Classes
- AbstractAkkaConnection → Connection
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDatabase: Int
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- def getNameOpt: Option[String]
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- def getPasswordOpt: Option[String]
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val host: String
- Definition Classes
- AbstractAkkaConnection
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- var isShuttingDown: Boolean
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val listenerActor: ActorRef
- Attributes
- protected
- Definition Classes
- SubscriberAkkaConnection → AbstractAkkaConnection
- lazy val logger: Logger
- Attributes
- protected
- Definition Classes
- LazyLogging
- Annotations
- @transient()
- val maxWriteBatchSize: Int
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- var nameOpt: Option[String]
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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.
- 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.
- var passwordOpt: Option[String]
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val port: Int
- Definition Classes
- AbstractAkkaConnection
- def quit(): Future[Unit]
Unsubscribes from all subscribed channels/patterns and then closes the connection.
- val receiveTimeoutOpt: Option[FiniteDuration]
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- def sendAsSubscriber(request: Request[_]): Future[Int]
- Attributes
- protected[scredis]
- Definition Classes
- SubscriberAkkaConnection → SubscriberConnection
- def setName(name: String): Future[Unit]
- Attributes
- protected
- Definition Classes
- SubscriberAkkaConnection
- def setSubscription(subscription: Subscription): Unit
- Attributes
- protected[scredis]
- Definition Classes
- SubscriberAkkaConnection → SubscriberConnection
- def shutdown(): Future[Unit]
- Attributes
- protected
- Definition Classes
- SubscriberAkkaConnection
- 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.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val system: ActorSystem
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val tcpReceiveBufferSizeHint: Int
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- val tcpSendBufferSizeHint: Int
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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.
- def updateState(request: Request[_]): Unit
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def watchTermination(): Unit
- Attributes
- protected
- Definition Classes
- AbstractAkkaConnection