scredis

ClientPool

final class ClientPool extends AnyRef

Configurable pool of clients to be used in a multi-threaded environment.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ClientPool
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ClientPool(configName: String, path: String)

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

    Constructs a scredis.ClientPool 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.ClientPool

    Note

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

  2. new ClientPool(configName: String)

    Constructs a scredis.ClientPool instance from a config file.

    Constructs a scredis.ClientPool instance from a config file.

    configName

    config filename

    returns

    the constructed scredis.ClientPool

    Note

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

    new ClientPool(configName, "scredis")
  3. new ClientPool(config: Config, path: String)

    Constructs a scredis.ClientPool instance from a com.

    Constructs a scredis.ClientPool instance from a com.typesafe.Config using the provided path.

    config

    com.typesafe.Config

    path

    path pointing to the scredis config object

    returns

    the constructed scredis.ClientPool

    Note

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

  4. new ClientPool(config: Config)

    Constructs a scredis.ClientPool instance from a com.

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

    config

    com.typesafe.Config

    returns

    the constructed scredis.ClientPool

    Note

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

    new ClientPool(config, "scredis")
  5. new ClientPool(config: RedisConfig)

    Constructs a scredis.ClientPool instance from a scredis.RedisConfig

    Constructs a scredis.ClientPool instance from a scredis.RedisConfig

    config

    scredis.RedisConfig

    returns

    the constructed scredis.ClientPool

  6. new ClientPool(config: Config = RedisConfigDefaults.Pool.Config, testWithPing: Boolean = ...)(host: String = RedisConfigDefaults.Client.Host, port: Int = RedisConfigDefaults.Client.Port, password: Option[String] = RedisConfigDefaults.Client.Password, database: Int = RedisConfigDefaults.Client.Database, timeout: Duration = RedisConfigDefaults.Client.Timeout, tries: Int = RedisConfigDefaults.Client.Tries, sleep: Option[FiniteDuration] = RedisConfigDefaults.Client.Sleep)

    config

    apache pool config (org.apache.commons.pool.impl.GenericObjectPool.Config)

    testWithPing

    when true, internal clients are validated with a PING command, when false, only socket information are used (less reliable but more performant)

    host

    server address

    port

    server port

    password

    server password

    database

    database index to select

    timeout

    maximum duration for the execution of a command, can be infinite

    tries

    maximum number of times the command will be executed in case recoverable errors occur such as timeouts

    sleep

    duration of time to sleep between subsequent tries

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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def auth(passwordOpt: Option[String])(implicit opts: CommandOptions = DefaultCommandOptions): Unit

    Authenticates/Deauthenticates all clients to/from the server.

    Authenticates/Deauthenticates all clients to/from the server.

    passwordOpt

    the server password, or None if the server does not require any

    Since

    1.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if the password is incorrect

    Note

    If the provided password is incorrect, then whatever was set as the password before remains.

  6. def borrowClient(): Client

    Borrows a Client from the pool

    Borrows a Client from the pool

    returns

    the borrowed Client

    Note

    this can throw an exception depending on how it is configured, e.g. if bounded and non-blocking

  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def close(): Unit

    Shutdowns the pool as well as every contained Client.

  9. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  18. def returnClient(client: Client): Unit

    Returns a borrowed Client to the pool

  19. def select(db: Int)(implicit opts: CommandOptions = DefaultCommandOptions): Unit

    Changes the selected database on all clients.

    Changes the selected database on all clients.

    db

    database index

    Since

    1.0.0

    Exceptions thrown
    [[scredis.exceptions.RedisCommandException]]

    if the database index is invalid

    Note

    if the provided database index is invalid then previously set index remains.

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

    Definition Classes
    AnyRef
  21. def toString(): String

    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def withClient[A](body: (Client) ⇒ A): A

Inherited from AnyRef

Inherited from Any

Ungrouped