Circuit breaker design pattern: Difference between revisions

Content deleted Content added
No edit summary
naming
Line 44:
$db = mysql_connect('localhost','user','pass');
if ($db === false) {
apc_store('dbUpdbStatus', 'down');
} else {
apc_store('dbUpdbStatus', 'up');
@mysql_close($db);
}
Line 54:
 
<source lang="php">
if (apc_fetch('dbUpdbStatus') === 'down') {
echo "The database server is currently not available. Please try again in a minute.";
exit;