Skip to content

Referans SDK Cluster

Cavanshirpro edited this page Sep 19, 2026 · 1 revision

SDK: cluster, circuit breaker ve bulk imzaları

English · Türkçe · Languages / Diller

Kapsam: JSON API Forge 0.5.1 · İnceleme: 17 Eylül 2026 · Dil: Türkçe

İmzalar kaynak dosyaların Python AST’sinden çıkarılmıştır; örnek olarak çalıştırılacak program değildir. self, sınıf instance’ı üzerinden çağrılırken ayrıca geçirilmez. * sonrasındaki argümanlar anahtar adıyla gönderilir. async def await edilir; dataclass alanları constructor parametrelerini de açıklar.

Cluster ve bulk rehberi.

Kaynak modül: json_api_forge/enterprise.py

RoutingStrategy

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

ForgeEndpoint

Alan Tip Varsayılan
name str Zorunlu
base_url str Zorunlu
api_key str | None None
weight int 1
allow_insecure_http bool False

CircuitBreakerPolicy

Alan Tip Varsayılan
failure_threshold int 3
recovery_seconds float 15.0

BulkResult

Alan Tip Varsayılan
index int Zorunlu
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: ...

Kaynak ve doğrulama

Bu sayfa aşağıdaki sabit commitlerdeki davranışı açıklar. Yeni bir sürümde aynı davranışın sürdüğünü varsaymayın.


Wiki ana sayfa · Tüm sayfalar · Sürüm ve bakım

Clone this wiki locally