mirror of
https://github.com/danog/amp.git
synced 2024-12-04 18:38:17 +01:00
26 lines
355 B
PHP
26 lines
355 B
PHP
<?php
|
|
|
|
namespace Amp\Loop;
|
|
|
|
final class DriverControl
|
|
{
|
|
private $run;
|
|
private $stop;
|
|
|
|
public function __construct(callable $run, callable $stop)
|
|
{
|
|
$this->run = $run;
|
|
$this->stop = $stop;
|
|
}
|
|
|
|
public function run()
|
|
{
|
|
($this->run)();
|
|
}
|
|
|
|
public function stop()
|
|
{
|
|
($this->stop)();
|
|
}
|
|
}
|