JobsClientSync
JobsClientSync(gateway: JobsGatewaySync, *, config: "Config | None" = None)Synchronous jobs client (public API for connect_sync()).
Methods
Section titled “Methods”.close()
Section titled “.close()”JobsClientSync.close() -> NoneClose underlying resources (best-effort).
Note: current sync gateways are SQL-only and typically have nothing to close.
Returns:
None- Always returnsNone.
.get()
Section titled “.get()”JobsClientSync.get( reasoner_type: str, job_id: str, *, include: JobIncludeDict | None = None) -> Job | NoneGet a normalized job/transaction by (reasoner_type, job_id).
By default returns a stable common schema. Use include= to opt into
backend-specific expansions (e.g. details, events, artifacts, problems, raw).
Returns:
Job|None- The job/transaction, orNoneif not found.
.create()
Section titled “.create()”JobsClientSync.create( reasoner_type: str, reasoner_name: str, payload: dict[str, Any], *, timeout_mins: int | None = None) -> JobOperationSyncStart a job/transaction and return a non-blocking operation handle (sync).
Note: reasoner_name identifies which reasoner/worker to run on.
Returns:
JobOperationSync- An operation handle; callop.wait(...)to block for completion.
.create_ready()
Section titled “.create_ready()”JobsClientSync.create_ready( reasoner_type: str, reasoner_name: str, payload: dict[str, Any], *, timeout_mins: int | None = None, timeout_s: float = 900, poll_interval_s: float = 0.5, include: JobIncludeDict | None = None) -> JobCreate a job and block until it reaches a terminal state.
Returns:
Job- The final job/transaction (possibly expanded wheninclude=is provided).
.list()
Section titled “.list()”JobsClientSync.list( reasoner_type: str | None = None, *, job_id: str | None = None, state: str | None = None, name: str | None = None, created_by: str | None = None, only_active: bool = False, all_users: bool = False, limit: int | None = None, include: JobIncludeDict | None = None) -> list[Job]List jobs/transactions, optionally filtered and optionally expanded (sync).
If reasoner_type is None, lists across all supported job types and
merges the results, sorting by created_on (desc).
Returns:
list[Job] - Matching jobs/transactions (possibly expanded wheninclude=is provided).
.get_events()
Section titled “.get_events()”JobsClientSync.get_events( reasoner_type: str, job_id: str, continuation_token: str = "", *, stream_name: str = "progress") -> JobEventsGet events for a job or transaction.
Works for all reasoner types and backends:
- LOGIC (DA):
GET /v1alpha1/transactions/{txn_id}/events/{stream_name} - LOGIC (SQL):
{app}.api.get_own_transaction_events(txn_id, continuation_token) - Non-LOGIC (DA):
GET /v1alpha1/jobs/{job_type}/{job_id}/events/{stream_name} - Non-LOGIC (SQL):
{app}.{schema}.GET_JOB_EVENTS(reasoner_type, job_id, token)
Returns:
JobEvents- Event page includingeventsand an optionalcontinuation_token.
.cancel()
Section titled “.cancel()”JobsClientSync.cancel(reasoner_type: str, job_id: str, *, all_users: bool = False) -> NoneCancel a running job/transaction (sync).
Cancellation is supported for both non-LOGIC jobs and LOGIC transactions.
cancel(all_users=True) is only supported for LOGIC transactions; non-LOGIC
jobs reject it.
Returns:
None- Always returnsNone.
.wait()
Section titled “.wait()”JobsClientSync.wait( reasoner_type: str, job_id: str, *, timeout_s: float = 900, poll_interval_s: float = 0.5, include: JobIncludeDict | None = None) -> JobPoll get(...) until the execution reaches a terminal state (sync).
Raises JobTimeoutError when timeout_s is exceeded.
Returns:
Job- The final job/transaction (possibly expanded wheninclude=is provided).
.get_operation()
Section titled “.get_operation()”JobsClientSync.get_operation(reasoner_type: str, job_id: str) -> OperationDerive a normalized operation status from the current job state.
Returns:
Operation- A normalized operation status.