Skip to content

Commit 1e58469

Browse files
committed
Be a little more specific about enable/definition
Enable is when things get put back to the queue, hence that order shall be respected. Otherwise we get undefined behaviors when disabling deferreds which have yet to be executed and re-enabling them after the point they should have been executed.
1 parent ccb2180 commit 1e58469

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Loop/Driver.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function stop();
2828
/**
2929
* Defer the execution of a callback.
3030
*
31-
* The deferred callable MUST be executed in the next tick of the event loop and before any other type of watcher. Order of definition MUST be preserved when executing the callbacks.
31+
* The deferred callable MUST be executed in the next tick of the event loop and before any other type of watcher. Order of enabling MUST be preserved when executing the callbacks.
3232
*
3333
* @param callable(string $watcherId, mixed $data) $callback The callback to defer. The $watcherId will be invalidated before the callback call.
3434
* @param mixed $data Arbitrary data given to the callback function as the $data parameter.
@@ -40,7 +40,7 @@ public function defer(callable $callback, $data = null);
4040
/**
4141
* Delay the execution of a callback.
4242
*
43-
* The delay is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first and secondarily the order of definition.
43+
* The delay is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first and secondarily the order of enabling.
4444
*
4545
* @param int $delay The amount of time, in milliseconds, to delay the execution for.
4646
* @param callable(string $watcherId, mixed $data) $callback The callback to delay. The $watcherId will be invalidated before the callback call.
@@ -53,7 +53,7 @@ public function delay($delay, callable $callback, $data = null);
5353
/**
5454
* Repeatedly execute a callback.
5555
*
56-
* The interval between executions is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first and secondarily the order of definition.
56+
* The interval between executions is a minimum and approximate, accuracy is not guaranteed. Order of calls MUST be determined by which timers expire first and secondarily the order of enabling.
5757
* The first execution is scheduled after the first interval period.
5858
*
5959
* @param int $interval The time interval, in milliseconds, to wait between executions.
@@ -67,7 +67,7 @@ public function repeat($interval, callable $callback, $data = null);
6767
/**
6868
* Execute a callback when a stream resource becomes readable.
6969
*
70-
* In case of multiple watchers on a same stream, order of definition MUST be preserved when executing the callbacks.
70+
* In case of multiple watchers on a same stream, order of enabling MUST be preserved when executing the callbacks.
7171
*
7272
* @param resource $stream The stream to monitor.
7373
* @param callable(string $watcherId, resource $stream, mixed $data) $callback The callback to execute.
@@ -80,7 +80,7 @@ public function onReadable($stream, callable $callback, $data = null);
8080
/**
8181
* Execute a callback when a stream resource becomes writable.
8282
*
83-
* In case of multiple watchers on a same stream, order of definition MUST be preserved when executing the callbacks.
83+
* In case of multiple watchers on a same stream, order of enabling MUST be preserved when executing the callbacks.
8484
*
8585
* @param resource $stream The stream to monitor.
8686
* @param callable(string $watcherId, resource $stream, mixed $data) $callback The callback to execute.
@@ -93,7 +93,7 @@ public function onWritable($stream, callable $callback, $data = null);
9393
/**
9494
* Execute a callback when a signal is received.
9595
*
96-
* In case of multiple watchers on a same signal, order of definition MUST be preserved when executing the callbacks.
96+
* In case of multiple watchers on a same signal, order of enabling MUST be preserved when executing the callbacks.
9797
*
9898
* @param int $signo The signal number to monitor.
9999
* @param callable(string $watcherId, int $signo, mixed $data) $callback The callback to execute.

0 commit comments

Comments
 (0)