notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.core.lock_store
LockError Objects
Exception that is raised when a lock cannot be acquired.
Attributes:
messagestr - explanation of whichconversation_idraised the error
LockStore Objects
create
Factory to create a lock store.
create_lock
Create a new TicketLock for conversation_id.
get_lock
Fetch lock for conversation_id from storage.
delete_lock
Delete lock for conversation_id from storage.
save_lock
Commit lock to storage.
issue_ticket
Issue new ticket with lock_lifetime for lock associated with
conversation_id.
Creates a new lock if none is found.
lock
Acquire lock with lifetime lock_lifetimefor conversation_id.
Try acquiring lock with a wait time of wait_time_in_seconds seconds
between attempts. Raise a LockError if lock has expired.
update_lock
Fetch lock for conversation_id, remove expired tickets and save lock.
get_or_create_lock
Fetch existing lock for conversation_id or create a new one if
it doesn't exist.
is_someone_waiting
Return whether someone is waiting for lock associated with
conversation_id.
finish_serving
Finish serving ticket with ticket_number for conversation_id.
Removes ticket from lock and saves lock.
cleanup
Remove lock for conversation_id if no one is waiting.
RedisLockStore Objects
Redis store for ticket locks.
__init__
Create a lock store which uses Redis for persistence.
Arguments:
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.password- The password which should be used for authentication with the Redis database.use_ssl-Trueif SSL should be used for the connection to Redis.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 withinsocket_timeoutseconds.
get_lock
Retrieves lock (see parent docstring for more information).
InMemoryLockStore Objects
In-memory store for ticket locks.
