| Methods |
public
|
__construct(Clock $clock = new SystemClock(), int<1, max> $maxRecords = self::DEFAULT_MAX_RECORDS)
Parameters
| $maxRecords |
Records held at once, settled ones included
|
|
#
|
public
|
createTask(string $toolName, ?array $arguments, ?int $ttlMs, int $pollIntervalMs): TaskRecord
Creates a durable record in the working status and returns it.
Creates a durable record in the working status and returns it.
Implements
|
#
|
public
|
findTask(string $taskId): ?TaskRecord
The record for $taskId, or null when it never existed or its
retention window has lapsed.
The record for $taskId, or null when it never existed or its
retention window has lapsed.
Implements
|
#
|
public
|
trySetWorking(string $taskId): bool
Returns the task to working, clearing its pending input requests.
Returns the task to working, clearing its pending input requests.
Returns
false when the record is terminal or absent
Implements
|
#
|
public
|
trySetCompleted(string $taskId, array $result): bool
Completes the task with its stored result payload, a tool error result included.
Completes the task with its stored result payload, a tool error result included.
Returns
false when the record is terminal or absent
Implements
|
#
|
public
|
trySetFailed(string $taskId, array $error, ?string $statusMessage = null): bool
Fails the task with a protocol-level error payload.
Fails the task with a protocol-level error payload.
Returns
false when the record is terminal or absent
Implements
|
#
|
public
|
trySetCancelled(string $taskId): bool
Returns
false when the record is terminal or absent
Implements
|
#
|
public
|
trySetInputRequired(string $taskId, array $inputRequests, ?string $requestState): bool
Parks the task in input_required with the given requests and the
continuation token to re-dispatch with, refusing a key already issued
since request keys are unique per task.
Parks the task in input_required with the given requests and the
continuation token to re-dispatch with, refusing a key already issued
since request keys are unique per task.
Returns
false when the record is terminal or absent
Implements
|
#
|
public
|
resolveInputRequests(string $taskId, array $inputResponses): ?TaskRecord
Merges answers into the record, ignoring a response for a key that is not
currently outstanding and accumulating every accepted answer for the next
re-dispatch.
Merges answers into the record, ignoring a response for a key that is not
currently outstanding and accumulating every accepted answer for the next
re-dispatch.
Returns
the updated record, or null when it is absent
Implements
|
#
|