Circuit Breaker

TsgcWSCircuitBreaker — the Circuit Breaker resilience pattern for client-side calls to HTTP APIs. Stop sending requests to a failing upstream the moment it goes down: fail fast, recover gracefully and let the remote service breathe.

TsgcWSCircuitBreaker

Closed / Open / Half-Open circuit-breaker for HTTP API calls. Short-circuits requests when an upstream becomes unhealthy, so your app fails fast.

Klasa komponentu

TsgcWSCircuitBreaker

Protokół

Client-side resilience — attaches to any sgc HTTP / AI / API component that exposes a CircuitBreaker property.

Platformy

Windows, macOS, Linux, iOS, Android

Edycja

Standard / Professional / Enterprise

Drop the component, set a few properties, go

Set thresholds, hook the three lifecycle events, then attach the breaker to any HTTP component.

uses
  sgcCircuitBreaker;

var
  CB: TsgcWSCircuitBreaker;
begin
  CB := TsgcWSCircuitBreaker.Create(nil);
  CB.FailureThreshold := 5;
  CB.ResetTimeout     := 30;  // seconds

  CB.OnCircuitBreakerOpen     := DoOpen;
  CB.OnCircuitBreakerHalfOpen := DoHalfOpen;
  CB.OnCircuitBreakerClose    := DoClose;

  // Attach to an HTTP / API component that exposes a CircuitBreaker property
  Anthropic.CircuitBreaker := CB;
end;

Co jest w środku

10 published properties, 17 methods, 5 events — pulled from the component reference.

Configuration

Published properties: Thresholds, TimeWindow, Recovery.

Diagnostics

Published properties: Metrics.

Core

Properties: Enabled, DefaultKey, ServerKey.

Execution

Methods: Execute, ExecuteWithResult, IsCallAllowed.

Recording

Methods: RecordSuccess, RecordFailure, RecordMessageSuccess.

Integration

Methods: IsConnectionAllowed, IsMessageAllowed, RegisterConnection.

Dokumentacja i dema

Bezpośredni link do dokumentacji komponentu, gotowy do uruchomienia projekt demo i pobieranie wersji próbnej.

Demo Project — 01.WebSocket\08.CircuitBreaker Gotowy do uruchomienia projekt przykładowy. Dostarczany w pakiecie sgcWebSockets — pobierz wersję próbną poniżej.
Dokument techniczny (PDF) Funkcje, szybki start, przykłady kodu dla Delphi i C++ Builder oraz źródła pierwotne — tylko ten komponent.
Podręcznik użytkownika (PDF) Kompleksowy podręcznik obejmujący każdy komponent biblioteki.

Stop Cascading Failures Today

Pobierz bezpłatną wersję próbną i dodaj the Circuit Breaker pattern to your sgcWebSockets HTTP API clients.