Skip to content

EN Reference SDK Clusters

Cavanshirpro edited this page Sep 19, 2026 · 1 revision

SDK: clusters, circuit breakers and bulk signatures

English · Türkçe · Languages / Diller

Scope: JSON API Forge 0.5.1 · Source review: 17 September 2026 · Language: English

Signatures are extracted from source Python AST and are reference declarations, not a runnable program. Do not pass self explicitly when calling an instance. Arguments after * are keyword-only. Await async def methods. Dataclass fields also describe constructor parameters.

Cluster and bulk guide.

Source module: json_api_forge/enterprise.py

RoutingStrategy

__str__ = str.__str__
__format__ = str.__format__
ROUND_ROBIN = 'round_robin'
RENDEZVOUS = 'rendezvous'

ForgeEndpoint

Field Type Default
name str Required
base_url str Required
api_key str | None None
weight int 1
allow_insecure_http bool False

CircuitBreakerPolicy

Field Type Default
failure_threshold int 3
recovery_seconds float 15.0

BulkResult

Field Type Default
index int Required
value T | None None
error Exception | None None

BulkResult.succeeded

@property
def succeeded(self) -> bool: ...

ForgeCluster

ForgeCluster.init

def __init__(self, endpoints: Sequence[ForgeEndpoint], *, strategy: RoutingStrategy=RoutingStrategy.ROUND_ROBIN, circuit_breaker: CircuitBreakerPolicy | None=None, client_factory: Callable[[ForgeEndpoint], ForgeClient] | None=None): ...

ForgeCluster.request

def request(self, method: str, path: str, *, routing_key: str | None=None, **kwargs: Any) -> ForgeResponse[Any]: ...

ForgeCluster.call_operation

def call_operation(self, project: str, operation: str, payload: Mapping[str, Any], *, routing_key: str | None=None, idempotency_key: str | None=None) -> ForgeResponse[Any]: ...

ForgeCluster.bulk_create

def bulk_create(self, project: str, resource: str, payloads: Iterable[Mapping[str, Any]], *, max_workers: int=8, max_items: int=10000, idempotency_key: Callable[[int, Mapping[str, Any]], str | None] | None=None, routing_key: Callable[[int, Mapping[str, Any]], str | None] | None=None) -> list[BulkResult[ForgeResponse[Any]]]: ...

ForgeCluster.health_all

def health_all(self) -> dict[str, ForgeResponse[Any] | Exception]: ...

ForgeCluster.close

def close(self) -> None: ...

ForgeCluster.enter

def __enter__(self) -> ForgeCluster: ...

ForgeCluster.exit

def __exit__(self, *_args: Any) -> None: ...

AsyncForgeCluster

AsyncForgeCluster.init

def __init__(self, endpoints: Sequence[ForgeEndpoint], *, strategy: RoutingStrategy=RoutingStrategy.ROUND_ROBIN, circuit_breaker: CircuitBreakerPolicy | None=None, client_factory: Callable[[ForgeEndpoint], AsyncForgeClient] | None=None): ...

AsyncForgeCluster.request

async def request(self, method: str, path: str, *, routing_key: str | None=None, **kwargs: Any) -> ForgeResponse[Any]: ...

AsyncForgeCluster.call_operation

async def call_operation(self, project: str, operation: str, payload: Mapping[str, Any], *, routing_key: str | None=None, idempotency_key: str | None=None) -> ForgeResponse[Any]: ...

AsyncForgeCluster.bulk

async def bulk(self, operations: Iterable[Callable[[], Awaitable[T]]], *, concurrency: int=16, max_items: int=10000) -> list[BulkResult[T]]: ...

AsyncForgeCluster.health_all

async def health_all(self) -> dict[str, ForgeResponse[Any] | Exception]: ...

AsyncForgeCluster.aclose

async def aclose(self) -> None: ...

AsyncForgeCluster.aenter

async def __aenter__(self) -> AsyncForgeCluster: ...

AsyncForgeCluster.aexit

async def __aexit__(self, *_args: Any) -> None: ...

Sources and verification

This page describes the behavior at the pinned commits below. Recheck these contracts when upgrading.


English home · All English pages · Version maintenance

Clone this wiki locally