-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSystemStrand.php
More file actions
68 lines (59 loc) · 1.61 KB
/
SystemStrand.php
File metadata and controls
68 lines (59 loc) · 1.61 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
declare(strict_types=1); // @codeCoverageIgnore
namespace Recoil\Kernel;
use Recoil\Kernel\Exception\PrimaryListenerRemovedException;
use Recoil\Listener;
use Recoil\Strand;
/**
* A low-level strand interface for use within the kernel.
*/
interface SystemStrand extends Strand
{
/**
* Get the kernel that the strand is running on.
*/
public function kernel(): SystemKernel;
/**
* Set the primary listener.
*
* If the current primary listener is not the kernel, it is notified with
* a {@see PrimaryListenerRemovedException}.
*
* @return null
*/
public function setPrimaryListener(Listener $listener);
/**
* Set the primary listener to the kernel.
*
* The current primary listener is not notified.
*
* @return null
*/
public function clearPrimaryListener();
/**
* Set the strand 'terminator'.
*
* The terminator is a function invoked when the strand is terminated. It is
* used by the kernel API to clean up any pending asynchronous operations.
*
* The terminator function is removed without being invoked when the strand
* is resumed.
*
* @return null
*/
public function setTerminator(callable $fn = null);
/**
* Create a uni-directional link to another strand.
*
* If this strand exits, any linked strands are terminated.
*
* @return null
*/
public function link(self $strand);
/**
* Break a previously created uni-directional link to another strand.
*
* @return null
*/
public function unlink(self $strand);
}