shippinno / heartbeat
Installs: 1 670
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
Requires
- php: ^7.4
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- mockery/mockery: ^1.1
- phpunit/phpunit: ^7.3
- squizlabs/php_codesniffer: ^3.3
This package is not auto-updated.
Last update: 2024-12-12 05:36:19 UTC
README
Let the stuff heartbeat and monitor if it is alive.
Currently it only supports Dead Man's Snitch.
Installation
$ composer require shippinno/heartbeat
Usage
Set up a Heartbeater singleton, with a heart and channels.
$heartbeater = Heartbeater::instance(); $heartbeater->setHeart(new DeadMansSnitchHeart(new Client); $heartbeater->setChannels([ 'vital' => 'SNITCH_TOKEN', ]);
Let it heartbeat forever.
class Dude { public function live() { $alive = true; while ($alive) { Heartbeat::instance()->heartbeat('vital'); sleep(1); } } }