Skip to content

AsyncOperationBuilder

Class: warmhub.AsyncOperationBuilder

AsyncOperationBuilder(submit: AsyncSubmitCallable, *, options: CommitOptions | None = None, shapes: Mapping[str, ShapeFields] | None = None)

The awaitable half of the pair.

Identical to OperationBuilder apart from commit, which is a coroutine function:

batch = repo.batch(message="seed")
batch.add(name="Reading/probe-1", data={"temp_celsius": 21.0})
result = await batch.commit()

Forgetting the await is inert rather than damaging: the body does not run, nothing is submitted, no state changes, and Python’s own RuntimeWarning: coroutine ... was never awaited names the mistake. The builder is still usable afterwards.

add(*, name: str | Unset = UNSET, kind: CommitOperationKind | Unset = UNSET, about: str | Unset = UNSET, data: JsonValue | Unset = UNSET, type: str | Unset = UNSET, members: Sequence[str] | Unset = UNSET, affirmed_targets: Sequence[str] | Unset = UNSET, skip_existing: bool | Unset = UNSET)

Queue an add. Returns self so calls chain.

revise(*, name: str | Unset = UNSET, wref: str | Unset = UNSET, kind: CommitOperationKind | Unset = UNSET, data: JsonValue | Unset = UNSET, type: str | Unset = UNSET, members: Sequence[str] | Unset = UNSET, affirmed_targets: Sequence[str] | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)

Queue a revise. Returns self so calls chain.

retract(name: str, *, kind: CommitOperationKind | Unset = UNSET, reason: str | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)

Queue a retract. Returns self so calls chain.

reaffirm(name: str, *, kind: CommitOperationKind | Unset = UNSET, add: Sequence[str] | Unset = UNSET, remove: Sequence[str] | Unset = UNSET, expected_version: int | Unset = UNSET, lease_id: str | Unset = UNSET)

Queue a reaffirm. Returns self so calls chain.

Edits which pinned target versions the assertion’s claim is affirmed for, without changing claim data. add and remove compose in one operation; already-present and already-absent targets are reported as ignored rather than failing.

rename(name: str, new_name: str, *, kind: CommitOperationKind | Unset = UNSET)

Queue a rename. Returns self so calls chain.

has(name: str)

Whether an add for name is already queued.

validate()

Run client-side validation without contacting the server.

commit(*, extra_headers: Omittable[Mapping[str, str]] = UNSET, extra_query: Omittable[Mapping[str, str]] = UNSET)

Validate, submit, and seal the builder.

Validation failures raise before any request is issued, and before the first suspension point. Ambiguous failures surface as PartialStreamSubmissionError; a deterministic all-failed batch surfaces as AllStreamOperationsFailedError.

operations

The queued operations, as an immutable snapshot.

size

Documentation is not yet available.

submitted

Documentation is not yet available.