Class

io.scalajs.npm.redis

RedisClientOptions

Related Doc: package redis

Permalink

class RedisClientOptions extends Object

Redis Connection Options

Annotations
@ScalaJSDefined() @RawJSType()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RedisClientOptions
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RedisClientOptions(host: UndefOr[String] = js.undefined, port: UndefOr[Int] = js.undefined, path: UndefOr[String] = js.undefined, url: UndefOr[String] = js.undefined, parser: UndefOr[String] = js.undefined, string_numbers: UndefOr[Boolean] = js.undefined, return_buffers: UndefOr[Boolean] = js.undefined, detect_buffers: UndefOr[Boolean] = js.undefined, socket_keepalive: UndefOr[Boolean] = js.undefined, no_ready_check: UndefOr[Boolean] = js.undefined, enable_offline_queue: UndefOr[Boolean] = js.undefined, retry_max_delay: UndefOr[Int] = js.undefined, connect_timeout: UndefOr[Int] = js.undefined, max_attempts: UndefOr[Int] = js.undefined, retry_unfulfilled_commands: UndefOr[Boolean] = js.undefined, password: UndefOr[String] = js.undefined, db: UndefOr[String] = js.undefined, family: UndefOr[String] = js.undefined, disable_resubscribing: UndefOr[String] = js.undefined, rename_commands: UndefOr[Dictionary[String]] = js.undefined, tls: UndefOr[RedisTLS] = js.undefined, prefix: UndefOr[String] = js.undefined, retry_strategy: UndefOr[Function] = js.undefined)

    Permalink

    host

    127.0.0.1 IP address of the Redis server

    port

    6379 Port of the Redis server

    path

    null The UNIX socket string of the Redis server

    url

    null The URL of the Redis server. Format:

    [redis:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]

    (More info avaliable at IANA).

    parser

    javascript Deprecated Use either the built-in JS parser javascript or the native hiredis parser. Note node_redis < 2.6 uses hiredis as default if installed. his changed in v.2.6.0.

    string_numbers

    null Set to true, node_redis will return Redis number values as Strings instead of javascript Numbers. Useful if you need to handle big numbers (above Number.MAX_SAFE_INTEGER ===

    2^53

    so setting this option to true will result in the built-in javascript parser being used no matter the value of the parser option.

    return_buffers

    false If set to true, then all replies will be sent to callbacks as Buffers instead of Strings.

    detect_buffers

    false If set to true, then replies will be sent to callbacks as Buffers. This option lets you switch between Buffers and Strings on a per-command basis, whereas return_buffers applies to every command on a client. Note: This doesn't work properly with the pubsub mode. A subscriber has to either always return Strings or Buffers.

    socket_keepalive

    true If set to true, the keep-alive functionality is enabled on the underlying socket.

    no_ready_check

    false When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server will not respond to any commands. To work around this, node_redis has a "ready check" which sends the INFO command to the server. The response from the INFO command indicates whether the server is ready for more commands. When ready, node_redis emits a ready event. Setting no_ready_check to true will inhibit this check.

    enable_offline_queue

    true By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established. Setting enable_offline_queue to false will disable this feature and the callback will be executed immediately with an error, or an error will be emitted if no callback is specified.

    retry_max_delay

    null Deprecated Please use retry_strategy instead. By default, every time the client tries to connect and fails, the reconnection delay almost doubles. This delay normally grows infinitely, but setting retry_max_delay limits it to the maximum value provided in milliseconds.

    connect_timeout

    3600000 Deprecated Please use retry_strategy instead. Setting connect_timeout limits the total time for the client to connect and reconnect. The value is provided in milliseconds and is counted from the moment a new client is created or from the time the connection is lost. The last retry is going to happen exactly at the timeout time. Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h has elapsed.

    max_attempts

    0 Deprecated Please use retry_strategy instead. By default, a client will try reconnecting until connected. Setting max_attempts limits total amount of connection attempts. Setting this to 1 will prevent any reconnect attempt.

    retry_unfulfilled_commands

    false If set to true, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished. Use this with caution if you use state altering commands (e.g. incr). This is especially useful if you use blocking commands.

    password

    null If set, client will run Redis auth command on connect. Alias auth_pass Note node_redis < 2.5 must use auth_pass

    db

    null If set, client will run Redis select command on connect.

    family

    IPv4 You can force using IPv6 if you set the family to 'IPv6'. See Node.js net or dns modules on how to use the family type.

    disable_resubscribing

    false If set to true, a client won't resubscribe after disconnecting.

    rename_commands

    null Passing an object with renamed commands to use instead of the original functions. For example, if you renamed the command KEYS to "DO-NOT-USE" then the rename_commands object would be: { KEYS : "DO-NOT-USE" } . See the Redis security topics for more info.

    tls

    null An object containing options to pass to tls.connect to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel).

    prefix

    null A string used to prefix all used keys (e.g. namespace:test). Please be aware that the keys command will not be prefixed. The keys command has a "pattern" as argument and no key and it would be impossible to determine the existing keys in Redis if this would be prefixed.

    retry_strategy

    function A function that receives an options object as parameter including the retry attempt, the total_retry_time indicating how much time passed since the last time connected, the error why the connection was lost and the number of times_connected in total. If you return a number from this function, the retry will happen exactly after that time in milliseconds. If you return a non-number, no further retry will happen and all offline commands are flushed with errors. Return an error to return that specific error to all offline commands.

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. val connect_timeout: UndefOr[Int]

    Permalink

    3600000 Deprecated Please use retry_strategy instead.

    3600000 Deprecated Please use retry_strategy instead. Setting connect_timeout limits the total time for the client to connect and reconnect. The value is provided in milliseconds and is counted from the moment a new client is created or from the time the connection is lost. The last retry is going to happen exactly at the timeout time. Default is to try connecting until the default system socket timeout has been exceeded and to try reconnecting until 1h has elapsed.

  7. val db: UndefOr[String]

    Permalink

    null If set, client will run Redis select command on connect.

  8. val detect_buffers: UndefOr[Boolean]

    Permalink

    false If set to true, then replies will be sent to callbacks as Buffers.

    false If set to true, then replies will be sent to callbacks as Buffers. This option lets you switch between Buffers and Strings on a per-command basis, whereas return_buffers applies to every command on a client. Note: This doesn't work properly with the pubsub mode. A subscriber has to either always return Strings or Buffers.

  9. val disable_resubscribing: UndefOr[String]

    Permalink

    false If set to true, a client won't resubscribe after disconnecting.

  10. val enable_offline_queue: UndefOr[Boolean]

    Permalink

    true By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established.

    true By default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection has been established. Setting enable_offline_queue to false will disable this feature and the callback will be executed immediately with an error, or an error will be emitted if no callback is specified.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. val family: UndefOr[String]

    Permalink

    IPv4 You can force using IPv6 if you set the family to 'IPv6'.

    IPv4 You can force using IPv6 if you set the family to 'IPv6'. See Node.js net or dns modules on how to use the family type.

  14. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. val host: UndefOr[String]

    Permalink

    127.0.0.1 IP address of the Redis server

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  21. val max_attempts: UndefOr[Int]

    Permalink

    0 Deprecated Please use retry_strategy instead.

    0 Deprecated Please use retry_strategy instead. By default, a client will try reconnecting until connected. Setting max_attempts limits total amount of connection attempts. Setting this to 1 will prevent any reconnect attempt.

  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. val no_ready_check: UndefOr[Boolean]

    Permalink

    false When a connection is established to the Redis server, the server might still be loading the database from disk.

    false When a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server will not respond to any commands. To work around this, node_redis has a "ready check" which sends the INFO command to the server. The response from the INFO command indicates whether the server is ready for more commands. When ready, node_redis emits a ready event. Setting no_ready_check to true will inhibit this check.

  24. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  26. val parser: UndefOr[String]

    Permalink

    javascript Deprecated Use either the built-in JS parser javascript or the native hiredis parser.

    javascript Deprecated Use either the built-in JS parser javascript or the native hiredis parser. Note node_redis < 2.6 uses hiredis as default if installed. his changed in v.2.6.0.

  27. val password: UndefOr[String]

    Permalink

    null If set, client will run Redis auth command on connect.

    null If set, client will run Redis auth command on connect. Alias auth_pass Note node_redis < 2.5 must use auth_pass

  28. val path: UndefOr[String]

    Permalink

    null The UNIX socket string of the Redis server

  29. val port: UndefOr[Int]

    Permalink

    6379 Port of the Redis server

  30. val prefix: UndefOr[String]

    Permalink

    null A string used to prefix all used keys (e.g.

    null A string used to prefix all used keys (e.g. namespace:test). Please be aware that the keys command will not be prefixed. The keys command has a "pattern" as argument and no key and it would be impossible to determine the existing keys in Redis if this would be prefixed.

  31. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  32. val rename_commands: UndefOr[Dictionary[String]]

    Permalink

    null Passing an object with renamed commands to use instead of the original functions.

    null Passing an object with renamed commands to use instead of the original functions. For example, if you renamed the command KEYS to "DO-NOT-USE" then the rename_commands object would be: { KEYS : "DO-NOT-USE" } . See the Redis security topics for more info.

  33. val retry_max_delay: UndefOr[Int]

    Permalink

    null Deprecated Please use retry_strategy instead.

    null Deprecated Please use retry_strategy instead. By default, every time the client tries to connect and fails, the reconnection delay almost doubles. This delay normally grows infinitely, but setting retry_max_delay limits it to the maximum value provided in milliseconds.

  34. val retry_strategy: UndefOr[Function]

    Permalink

    function A function that receives an options object as parameter including the retry attempt, the total_retry_time indicating how much time passed since the last time connected, the error why the connection was lost and the number of times_connected in total.

    function A function that receives an options object as parameter including the retry attempt, the total_retry_time indicating how much time passed since the last time connected, the error why the connection was lost and the number of times_connected in total. If you return a number from this function, the retry will happen exactly after that time in milliseconds. If you return a non-number, no further retry will happen and all offline commands are flushed with errors. Return an error to return that specific error to all offline commands.

  35. val retry_unfulfilled_commands: UndefOr[Boolean]

    Permalink

    false If set to true, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished.

    false If set to true, all commands that were unfulfilled while the connection is lost will be retried after the connection has been reestablished. Use this with caution if you use state altering commands (e.g. incr). This is especially useful if you use blocking commands.

  36. val return_buffers: UndefOr[Boolean]

    Permalink

    false If set to true, then all replies will be sent to callbacks as Buffers instead of Strings.

  37. val socket_keepalive: UndefOr[Boolean]

    Permalink

    true If set to true, the keep-alive functionality is enabled on the underlying socket.

  38. val string_numbers: UndefOr[Boolean]

    Permalink

    null Set to true, node_redis will return Redis number values as Strings instead of javascript Numbers.

    null Set to true, node_redis will return Redis number values as Strings instead of javascript Numbers. Useful if you need to handle big numbers (above Number.MAX_SAFE_INTEGER ===

    2^53

    so setting this option to true will result in the built-in javascript parser being used no matter the value of the parser option.

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

    Permalink
    Definition Classes
    AnyRef
  40. val tls: UndefOr[RedisTLS]

    Permalink

    null An object containing options to pass to tls.connect to set up a TLS connection to Redis (if, for example, it is set up to be accessible via a tunnel).

  41. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. val url: UndefOr[String]

    Permalink

    null The URL of the Redis server.

    null The URL of the Redis server. Format:

    [redis:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]

    (More info avaliable at IANA).

  44. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  45. final def wait(): Unit

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

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

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

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped