InMemoryRunQueue
The RunQueue of an InMemoryCheckpointer (InMemoryCheckpointer.runQueue): entries in memory, under the checkpointer's own lock, leases judged and closes stamped by its clock. It shares the checkpointer's lock so the checkpointer's deleteThread marks its open entries, and its prune reads their runs, in one step. awaitClosed wakes on closes rather than polling. Its calls take only each other's brief turn at the lock, so each returns at once.
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Waits on the queue's own closes rather than polling; see RunQueue.awaitClosed.
Waits on the queue's own closes rather than polling; see RunQueue.awaitClosed.
Attributes
- Definition Classes
Closes lease's entry with outcome and answers it closed; refused unless lease is current.
Closes lease's entry with outcome and answers it closed; refused unless lease is current.
Attributes
Entry entryId, if it is tenantId's: QueueError.TicketExpired for an id the store issued and no longer holds for the tenant (reclaimed, or another tenant's), QueueError.TicketNotFound for one it never issued.
Entry entryId, if it is tenantId's: QueueError.TicketExpired for an id the store issued and no longer holds for the tenant (reclaimed, or another tenant's), QueueError.TicketNotFound for one it never issued.
Attributes
tenantId's open entries on threadId, in the order they run (see the class doc); empty for an unknown thread.
tenantId's open entries on threadId, in the order they run (see the class doc); empty for an unknown thread.
Attributes
Removes up to limit closed entries whose close is ticketLifetime or more ago, by the store's clock, oldest first, input and attempts included, and answers how many it removed; never an open entry. The store-wide retention sweep (W2) calls it.
Removes up to limit closed entries whose close is ticketLifetime or more ago, by the store's clock, oldest first, input and attempts included, and answers how many it removed; never an open entry. The store-wide retention sweep (W2) calls it.
Attributes
Records an attempt at lease's entry running as runId, durably, before the caller touches the thread (rule 4); see AttemptStart. Refused unless lease is current, and with a ValidationError for a runId that already names a run on the thread - a checkpoint, or an attempt of any entry - since a reused RunId would name two runs and the run-id lookup would take the other for this attempt's. A worker gives each attempt RunId.random().
Records an attempt at lease's entry running as runId, durably, before the caller touches the thread (rule 4); see AttemptStart. Refused unless lease is current, and with a ValidationError for a runId that already names a run on the thread - a checkpoint, or an attempt of any entry - since a reused RunId would name two runs and the run-id lookup would take the other for this attempt's. A worker gives each attempt RunId.random().
Attributes
Gives the entry back without closing it - as a worker that defers to a live run on the thread does, recording no attempt - so it may be taken again at once. A lease that is not the current one changes nothing; a closed entry is QueueError.EntryClosed, so the worker knows it is terminal rather than requeued.
Gives the entry back without closing it - as a worker that defers to a live run on the thread does, recording no attempt - so it may be taken again at once. A lease that is not the current one changes nothing; a closed entry is QueueError.EntryClosed, so the worker knows it is terminal rather than requeued.
Attributes
Extends lease to ttl from now, by the store's clock; refused unless it is the entry's current lease.
Extends lease to ttl from now, by the store's clock; refused unless it is the entry's current lease.
Attributes
Queues submission, or finds the entry its key already names, and answers its Ticket. Refusals: GraphError.ThreadBusy for a Reject submission to a thread with an open entry, and QueueError.SubmissionKeyReused.
Queues submission, or finds the entry its key already names, and answers its Ticket. Refusals: GraphError.ThreadBusy for a Reject submission to a thread with an open entry, and QueueError.SubmissionKeyReused.
Attributes
Leases the oldest takeable head - see the class doc - whose agent is one of request.agents, to request.holder for request.ttl from now, by the store's clock; None if there is none.
Leases the oldest takeable head - see the class doc - whose agent is one of request.agents, to request.holder for request.ttl from now, by the store's clock; None if there is none.