TsgcWSCircuitBreaker › Methods

TsgcWSCircuitBreaker Methods

Public methods grouped by purpose, followed by the full alphabetical list.

Execution

NameDescription
ExecuteRuns a protected action; checks IsCallAllowed first and records success / failure / slow automatically.
ExecuteWithResultRuns a protected action that returns a TObject and reports the result via an out parameter.
IsCallAllowedReturns True when a new call is currently allowed for the given key; advances HalfOpen trial accounting.

Recording

NameDescription
RecordSuccessRecords a successful call; advances HalfOpen -> Closed when trial calls succeed.
RecordFailureRecords a failure against a key; applies Classification, updates counters and may open the circuit.
RecordMessageSuccessServer-side hook that records a successful message on ServerKey.
RecordMessageErrorServer-side hook that records a message failure on ServerKey.

Integration

NameDescription
IsConnectionAllowedServer-side gatekeeper that returns False while the ServerKey circuit is Open.
IsMessageAllowedServer-side gatekeeper that returns False when the ServerKey circuit is Open and rejects the message.
RegisterConnectionServer-side hook that tracks a new connection (reserved for future per-IP metrics).
UnregisterConnectionServer-side hook that stops tracking a disconnected connection (counterpart of RegisterConnection).

State control

NameDescription
ForceOpenManually moves the circuit for the given key into the Open state.
ForceCloseManually moves the circuit for the given key back to the Closed state.
ResetClears the state, rolling-window counters and last-success payload for a single key.
ResetAllClears every tracked circuit, every rolling-window counter and all aggregate Metrics.

Persistence

NameDescription
SaveStateToFilePersists every tracked circuit's state and counters to a file so they survive a restart.
LoadStateFromFileRestores circuit states and counters from a file previously written by SaveStateToFile.

All Methods (alphabetical)

NameDescription
ExecuteRuns a protected action; checks IsCallAllowed first and records success / failure / slow automatically.
ExecuteWithResultRuns a protected action that returns a TObject and reports the result via an out parameter.
ForceCloseManually moves the circuit for the given key back to the Closed state.
ForceOpenManually moves the circuit for the given key into the Open state.
IsCallAllowedReturns True when a new call is currently allowed for the given key; advances HalfOpen trial accounting.
IsConnectionAllowedServer-side gatekeeper that returns False while the ServerKey circuit is Open.
IsMessageAllowedServer-side gatekeeper that returns False when the ServerKey circuit is Open and rejects the message.
LoadStateFromFileRestores circuit states and counters from a file previously written by SaveStateToFile.
RecordFailureRecords a failure against a key; applies Classification, updates counters and may open the circuit.
RecordMessageErrorServer-side hook that records a message failure on ServerKey.
RecordMessageSuccessServer-side hook that records a successful message on ServerKey.
RecordSuccessRecords a successful call; advances HalfOpen -> Closed when trial calls succeed.
RegisterConnectionServer-side hook that tracks a new connection (reserved for future per-IP metrics).
ResetClears the state, rolling-window counters and last-success payload for a single key.
ResetAllClears every tracked circuit, every rolling-window counter and all aggregate Metrics.
SaveStateToFilePersists every tracked circuit's state and counters to a file so they survive a restart.
UnregisterConnectionServer-side hook that stops tracking a disconnected connection (counterpart of RegisterConnection).