Circuit breaker design pattern: Difference between revisions

Content deleted Content added
Drakosh (talk | contribs)
External links: to latest version
m change source to syntaxhighlight
Line 39:
The following script could be run on a set interval through [[crontab]].
 
<sourcesyntaxhighlight lang="php">
$mysqli = new mysqli('localhost', 'user', 'pass');
 
Line 48:
$mysqli->close();
}
</syntaxhighlight>
</source>
 
====Usage in an application====
 
<sourcesyntaxhighlight lang="php">
if (apc_fetch('dbStatus') === 'down') {
echo 'The database server is currently not available. Please try again in a minute.';
Line 60:
$mysqli = new mysqli('localhost', 'user', 'pass', 'database');
$result = $mysqli->query('SELECT * FROM table');
</syntaxhighlight>
</source>
 
==External links==