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
Ticket Objects
dumps
Return json dump of Ticket as dictionary.
from_dict
Creates Ticket from dictionary.
TicketLock Objects
Locking mechanism that issues tickets managing access to conversation IDs.
Tickets are issued in the order in which they are requested. A detailed explanation of the ticket lock algorithm can be found at http://pages.cs.wisc.edu/~remzi/OSTEP/threads-locks.pdf#page=13
from_dict
Create TicketLock from dictionary.
dumps
Return json dump of TicketLock.
is_locked
Return whether ticket_number is locked.
Returns:
True if now_serving is not equal to ticket.
issue_ticket
Issue a new ticket and return its number.
remove_expired_tickets
Remove expired tickets.
last_issued
Return number of the ticket that was last added.
Returns:
Number of Ticket that was last added. NO_TICKET_ISSUED if no
tickets exist.
now_serving
Get number of the ticket to be served next.
Returns:
Number of Ticket that is served next. 0 if no Ticket exists.
is_someone_waiting
Return whether someone is waiting for the lock to become available.
Returns:
True if the self.tickets queue has length greater than 0.
remove_ticket_for
Remove Ticket for `ticket_number.
