1
0
mirror of https://github.com/danog/amp.git synced 2024-12-12 09:29:45 +01:00
amp/src/EventLoopInterface.php

67 lines
1.1 KiB
PHP
Raw Normal View History

2016-01-20 12:01:40 +01:00
<?php
namespace Interop\Async\EventLoop;
interface EventLoopInterface
{
2016-02-17 16:25:39 +01:00
/**
* @return void
*/
public function run(callable $onStart = null);
/**
* @return void
*/
public function stop();
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function defer(callable $callback);
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function delay(callable $callback, float $time);
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function repeat(callable $callback, float $interval);
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function onReadable($stream, callable $callback);
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function onWritable($stream, callable $callback);
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function onSignal(int $signo, callable $callback);
2016-02-17 16:25:39 +01:00
/**
* @return string
2016-02-17 16:25:39 +01:00
*/
public function onError(callable $callback);
2016-02-17 16:25:39 +01:00
/**
* @return void
2016-02-17 16:25:39 +01:00
*/
public function enable(string $watcherId);
/**
* @return void
*/
public function disable(string $watcherId);
/**
* @return void
*/
public function cancel(string $watcherId);
2016-01-20 12:01:40 +01:00
}