Trait/Object

io.scalajs.npm.redis

RedisClient

Related Docs: object RedisClient | package redis

Permalink

trait RedisClient extends Object with IEventEmitter

Redis Client

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

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 addListener(eventName: String, listener: Function): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def auth(password: String, callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink

    When connecting to a Redis server that requires authentication, the AUTH command must be sent as the first command after connecting.

    When connecting to a Redis server that requires authentication, the AUTH command must be sent as the first command after connecting. This can be tricky to coordinate with reconnections, the ready check, etc. To make this easier, client.auth() stashes password and will send it after each connection, including reconnections. callback is invoked only once, after the response to the very first AUTH command sent. NOTE: Your call to client.auth() should not be inside the ready handler. If you are doing this wrong, client will emit an error that looks something like this Error: Ready check failed: ERR operation not permitted.

    password

    the user password

    callback

    the optional callback

  7. def batch(commands: Array[RedisCommand] = js.native): RedisMulti

    Permalink

    Identical to .multi without transactions.

    Identical to .multi without transactions. This is recommended if you want to execute many commands at once but don't have to rely on transactions.

    Example:
    1. batch([commands])

  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def command_queue_length: Int

    Permalink

    The number of commands that have been sent to the Redis server but not yet replied to.

    The number of commands that have been sent to the Redis server but not yet replied to. You can use this to enforce some kind of maximum queue depth for commands while connected.

  10. def connected: Boolean

    Permalink

    Boolean tracking the state of the connection to the Redis server.

  11. def del(keys: Array[String], callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink

    Deletes an array of records by their respective keys

    Deletes an array of records by their respective keys

    keys

    the given array of keys

    callback

    the given callback

  12. def del(key: String, callback: RedisCallback[RedisResponse]): Unit

    Permalink

    Deletes a record by key

    Deletes a record by key

    key

    the given key

    callback

    the given callback

  13. def del(key: String): Unit

    Permalink

    Deletes a key

    Deletes a key

    key

    the given key

  14. var domain: String

    Permalink
    Definition Classes
    IEventEmitter
  15. def dump(key: String, callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink

    Dumps a record by key

    Dumps a record by key

    key

    the given key

    callback

    the given callback

  16. def duplicate(options: RawOptions = js.native, callback: RedisCallback[RedisResponse]): Any

    Permalink

    Duplicate all current options and return a new redisClient instance.

    Duplicate all current options and return a new redisClient instance. All options passed to the duplicate function are going to replace the original option. If you pass a callback, duplicate is going to wait until the client is ready and returns it in the callback. If an error occurs in the meanwhile, that is going to return an error instead in the callback.

    options

    the optional settings

    callback

    the optional callback

  17. def emit(name: String, args: Any*): Any

    Permalink
    Definition Classes
    IEventEmitter
  18. def end(flush: Boolean = js.native): Unit

    Permalink

    Forcibly close the connection to the Redis server.

    Forcibly close the connection to the Redis server. Note that this does not wait until all replies have been parsed. If you want to exit cleanly, call client.quit() as mentioned above.

    You should set flush to true, if you are not absolutely sure you do not care about any other commands. If you set flush to false all still running commands will silently fail.

    flush

    indicates whether the want a flush to occur before closing the connection

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. def exists(key: Array[String], callback: RedisCallback[Int]): Any

    Permalink

    Indicates whether a key exists

    Indicates whether a key exists

    key

    the given key

    callback

    the given callback <Error, Integer>

  22. def exists(key: String, callback: RedisCallback[Int]): Any

    Permalink

    Indicates whether a key exists

    Indicates whether a key exists

    key

    the given key

    callback

    the given callback <Error, Integer>

  23. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  24. def get(key: String, callback: RedisCallback[String]): Unit

    Permalink
  25. def get(key: Buffer, callback: RedisCallback[Buffer]): Unit

    Permalink
  26. def getAsync(key: String): Promise[String]

    Permalink
  27. def getAsync(key: Buffer): Promise[Buffer]

    Permalink
  28. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  29. def getMaxListeners(): Int

    Permalink
    Definition Classes
    IEventEmitter
  30. def hasOwnProperty(v: String): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  32. def hgetall(key: String, callback: RedisCallback[Dictionary[String]]): Unit

    Permalink

    Most Redis commands take a single String or an Array of Strings as arguments, and replies are sent back as a single String or an Array of Strings.

    Most Redis commands take a single String or an Array of Strings as arguments, and replies are sent back as a single String or an Array of Strings. When dealing with hash values, there are a couple of useful exceptions to this.

    key

    the given hash key

    callback

    the callback

    Example:
    1. client.hmset("hosts", "mjr", "1", "another", "23", "home", "1234");
      client.hgetall("hosts", function (err, obj) {
          console.dir(obj);
      });
  33. def hkeys(key: String, callback: RedisCallback[Array[String]]): Unit

    Permalink
  34. def hmset(key: String, keyValuePairs: Array[String], callback: RedisCallback[RedisResponse]): Unit

    Permalink
  35. def hmset(key: String, keyValuePairs: Array[String]): Unit

    Permalink
  36. def hmset(key: String, keyValuePairs: String*): Unit

    Permalink
  37. def hset(key: String, hashKey: String, hashValue: String, callback: RedisCallback[RedisResponse]): Unit

    Permalink
  38. def hset(args: Array[String], callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink
  39. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  41. def listenerCount(eventName: String): Int

    Permalink
    Definition Classes
    IEventEmitter
  42. def listeners(eventName: String): Array[Function]

    Permalink
    Definition Classes
    IEventEmitter
  43. def monitor(callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink

    Redis supports the MONITOR command, which lets you see all commands received by the Redis server across all client connections, including from other client libraries and other computers.

    Redis supports the MONITOR command, which lets you see all commands received by the Redis server across all client connections, including from other client libraries and other computers.

    A monitor event is going to be emitted for every command fired from any client connected to the server including the monitoring client itself. The callback for the monitor event takes a timestamp from the Redis server, an array of command arguments and the raw monitoring string.

    callback

    the callback

  44. def mset(args: Array[Any], callback: RedisCallback[RedisResponse]): Unit

    Permalink
  45. def multi(args: Any*): RedisMulti

    Permalink
  46. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  49. def offline_queue_length: Int

    Permalink

    The number of commands that have been queued up for a future connection.

    The number of commands that have been queued up for a future connection. You can use this to enforce some kind of maximum queue depth for pre-connection commands.

  50. def on(eventName: String, listener: Function): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  51. def once(eventName: String, listener: Function): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  52. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  53. def publish(message: String*): Unit

    Permalink
  54. def quit(): Unit

    Permalink

    This sends the quit command to the redis server and ends cleanly right after all running commands were properly handled.

    This sends the quit command to the redis server and ends cleanly right after all running commands were properly handled. If this is called while reconnecting (and therefor no connection to the redis server exists) it is going to end the connection right away instead of resulting in further re-connections! All offline commands are going to be flushed with an error in that case.

  55. def removeAllListeners(): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  56. def removeAllListeners(eventName: String): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  57. def removeListener(eventName: String, listener: Function): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  58. def rename(fromKey: String, toKey: String, callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink
  59. def sadd(key: String, value: String): Unit

    Permalink

    Example:
    1. sadd("bigset", "a member");

  60. def scan[T](cursor: Int, command0: String, arg0: Any, command1: String, arg1: Any, command2: String, arg3: Any, callback: RedisCallback[T]): Unit

    Permalink
  61. def scan[T](cursor: Int, command0: String, arg0: Any, command1: String, arg1: Any, callback: RedisCallback[T]): Unit

    Permalink
  62. def scan[T](cursor: Int, command0: String, arg0: Any, callback: RedisCallback[T]): Unit

    Permalink
  63. def scan[T](cursor: Int, callback: RedisCallback[T]): Unit

    Permalink
  64. def script(args: String*): Unit

    Permalink

    Example:
    1. script('load', 'return 1')

  65. def send_command(commandName: String, args: Array[String] = js.native, callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink

    All Redis commands have been added to the client object.

    All Redis commands have been added to the client object. However, if new commands are introduced before this library is updated, you can use send_command() to send arbitrary commands to Redis. The command_name has to be lower case.

    All commands are sent as multi-bulk commands. args can either be an Array of arguments, or omitted / set to undefined.

    commandName

    the command name

    args

    the optional command arguments

    callback

    the optional callback

  66. def server_info: Dictionary[Any]

    Permalink

    After the ready probe completes, the results from the INFO command are saved in the client.server_info object.

  67. def set(args: Array[String], callback: RedisCallback[RedisResponse]): Unit

    Permalink

    Sets key-value pairs

    Sets key-value pairs

    args

    the collection of key-value pairs

    callback

    the callback

    Example:
    1. client.set(["some other key", "some val"]);

  68. def set(args: Array[String]): Unit

    Permalink

    Sets key-value pairs

    Sets key-value pairs

    args

    the collection of key-value pairs

    Example:
    1. client.set(["some other key", "some val"]);

  69. def set(key: String, value: String, callback: RedisCallback[RedisResponse] = js.native): Unit

    Permalink

    Sets a key-value pair

    Sets a key-value pair

    key

    the given key

    value

    the given value

    callback

    the callback

    Example:
    1. client.set("some key", "some val");

  70. def setMaxListeners(n: Int): RedisClient.this.type

    Permalink
    Definition Classes
    IEventEmitter
  71. def stream: ReadStream

    Permalink

    The client exposed the used stream in client.stream and if the stream or client had to buffer the command in client.should_buffer.

    The client exposed the used stream in client.stream and if the stream or client had to buffer the command in client.should_buffer. In combination this can be used to implement backpressure by checking the buffer state before sending a command and listening to the stream drain event.

  72. def subscribe(channel: RedisChannel): Unit

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

    Permalink
    Definition Classes
    AnyRef
  74. def toLocaleString(): String

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

    Permalink
    Definition Classes
    AnyRef → Any
  76. def unsubscribe(): Unit

    Permalink
  77. var usingDomains: Boolean

    Permalink
    Definition Classes
    IEventEmitter
  78. def valueOf(): Any

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  82. def zadd(args: Array[Any], callback: RedisCallback[RedisResponse]): Unit

    Permalink
  83. def zrevrangebyscore(args: Array[Any], callback: RedisCallback[RedisResponse]): Unit

    Permalink

Inherited from IEventEmitter

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped