class_docstr: Redis store for ticket locks.
class_docstr_tok: ["Redis","store","for","ticket","locks","."]
docstr: Create a lock store which uses Redis for persistence.
  
  Args:
      host: The host of the redis server.
      port: The port of the redis server.
      db: The name of the database within Redis which should be used by Rasa
          Open Source.
      username: The username which should be used for authentication with the
          Redis database.
      password: The password which should be used for authentication with the
          Redis database.
      use_ssl: `True` if SSL should be used for the connection to Redis.
      ssl_certfile: Path to the SSL certificate file.
      ssl_keyfile: Path to the SSL private key file.
      ssl_ca_certs: Path to the SSL CA certificate file.
      key_prefix: prefix to prepend to all keys used by the lock store. Must be
          alphanumeric.
      socket_timeout: Timeout in seconds after which an exception will be raised
          in case Redis doesn't respond within `socket_timeout` seconds.
code: def __init__(
      self,
      host: Text = "localhost",
      port: int = 6379,
      db: int = 1,
      username: Optional[Text] = None,
      password: Optional[Text] = None,
      use_ssl: bool = False,
      ssl_certfile: Optional[Text] = None,
      ssl_keyfile: Optional[Text] = None,
      ssl_ca_certs: Optional[Text] = None,
      key_prefix: Optional[Text] = None,
      socket_timeout: float = DEFAULT_SOCKET_TIMEOUT_IN_SECONDS,
  ) -> None:
      """Create a lock store which uses Redis for persistence.
  
      Args:
          host: The host of the redis server.
          port: The port of the redis server.
          db: The name of the database within Redis which should be used by Rasa
              Open Source.
          username: The username which should be used for authentication with the
              Redis database.
          password: The password which should be used for authentication with the
              Redis database.
          use_ssl: `True` if SSL should be used for the connection to Redis.
          ssl_certfile: Path to the SSL certificate file.
          ssl_keyfile: Path to the SSL private key file.
          ssl_ca_certs: Path to the SSL CA certificate file.
          key_prefix: prefix to prepend to all keys used by the lock store. Must be
              alphanumeric.
          socket_timeout: Timeout in seconds after which an exception will be raised
              in case Redis doesn't respond within `socket_timeout` seconds.
      """
      import redis
  
      self.red = redis.StrictRedis(
          host=host,
          port=int(port),
          db=int(db),
          username=username,
          password=password,
          ssl=use_ssl,
          ssl_certfile=ssl_certfile,
          ssl_keyfile=ssl_keyfile,
          ssl_ca_certs=ssl_ca_certs,
          socket_timeout=socket_timeout,
      )
  
      self.key_prefix = DEFAULT_REDIS_LOCK_STORE_KEY_PREFIX
      if key_prefix:
          logger.debug(
              f"Setting non-default redis key prefix: '{key_prefix}'."
          )
          self._set_key_prefix(key_prefix)
  
      super().__init__()
  
imports: from __future__ import annotations
  import asyncio
  from contextlib import asynccontextmanager
  import json
  import logging
  import os
  from typing import AsyncGenerator, Dict, Optional, Text, Union
  from rasa.shared.exceptions import RasaException, ConnectionException
  import rasa.shared.utils.common
  from rasa.core.constants import DEFAULT_LOCK_LIFETIME
  from rasa.core.lock import TicketLock
  from rasa.utils.endpoints import EndpointConfig
label_desc: Use image node_id 1 to create a new RedisLockStore object from inherited base classes: LockStore with example: obj = RedisLockStore(host, port, db, username, password, use_ssl, ssl_certfile, ssl_keyfile, ssl_ca_certs, key_prefix, socket_timeout)