Content deleted Content added
Improve specificity of implications overview |
No edit summary |
||
Line 30:
By how much depends on the storage layer used and generally available resources. The largest factors in this regard are the type of cache, for example, disk-based vs. memory-based and local vs. network.
== Different
* Closed
* Open
* Half
=== Closed State ===
Line 40:
[[File:Circuit Breaker -Closed state.png|thumb|Circuit Breaker Closed State]]
=== Open
In this state circuit breaker returns an error immediately without even invoking the services. The Circuit breakers move into the half-open state after a timeout period elapses. Usually, it will have a monitoring system where the timeout will be specified.
[[File:Circuit Breaker -Openstate.png|thumb|Circuit Breaker Open State]]
=== Half-open
In this state, the circuit breaker allows a limited number of requests from the Microservice to passthrough and invoke the operation. If the requests are successful, then the circuit breaker will go to the closed state. However, if the requests continue to fail, then it goes back to Open state.
Line 59:
<syntaxhighlight lang="php">
$mysqli = new mysqli(
if ($mysqli->connect_error) {
apc_store(
} else {
apc_store(
$mysqli->close();
}
Line 72:
<syntaxhighlight lang="php">
if (apc_fetch(
echo
exit;
}
$mysqli = new mysqli(
$result = $mysqli->query(
</syntaxhighlight>
|