-
Notifications
You must be signed in to change notification settings - Fork 42
/
SignalInterface.php
55 lines (45 loc) · 1.09 KB
/
SignalInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
* This file is part of Icicle, a library for writing asynchronous code in PHP using promises and coroutines.
*
* @copyright 2014-2015 Aaron Piotrowski. All rights reserved.
* @license Apache-2.0 See the LICENSE file that was distributed with this source code for more information.
*/
namespace Icicle\Loop\Events;
interface SignalInterface
{
/**
* Calls the callback associated with the timer.
*/
public function call();
/**
* Alias of call().
*/
public function __invoke();
/**
* @param callable $callback
*/
public function setCallback(callable $callback);
/**
* Enables listening for the signal.
*/
public function enable();
/**
* Disables listening for the signal.
*/
public function disable();
/**
* @return bool
*/
public function isEnabled();
/**
* Signal identifier constant value, such as SIGTERM or SIGCHLD.
*
* @return int
*/
public function getSignal();
/**
* @return \Icicle\Loop\LoopInterface
*/
public function getLoop();
}