From 5cbc42d6d98bdb71f3b9bea5837cacf8ea56e300 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Fri, 13 Jan 2017 15:14:01 +0100 Subject: [PATCH 1/4] Define 'tick' --- src/Loop/Driver.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Loop/Driver.php b/src/Loop/Driver.php index 2526495..9dadf34 100644 --- a/src/Loop/Driver.php +++ b/src/Loop/Driver.php @@ -15,7 +15,14 @@ abstract class Driver private $registry = []; /** - * Start the event loop. + * Runs the event loop. + * + * One iteration of the loop is called one "tick". A tick covers the following steps: + * + * 1. Activate watchers created / enabled in the last tick / before `run`. + * 2. Execute all enabled defer watchers. + * 3. Execute all due timers, each timer only once per tick. + * 4. Execute actionable stream watchers, each only once per tick. * * The loop MUST continue to run until it is either stopped explicitly, no referenced watchers exist anymore, or an * exception is thrown that cannot be handled. Exceptions that cannot be handled are exceptions thrown from an From 6884501aac78c979f3846d1f25c150c5b4069e31 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Fri, 13 Jan 2017 15:15:55 +0100 Subject: [PATCH 2/4] Fix typo --- src/Loop/Driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Loop/Driver.php b/src/Loop/Driver.php index 9dadf34..4883d11 100644 --- a/src/Loop/Driver.php +++ b/src/Loop/Driver.php @@ -15,7 +15,7 @@ abstract class Driver private $registry = []; /** - * Runs the event loop. + * Run the event loop. * * One iteration of the loop is called one "tick". A tick covers the following steps: * From 7f3a0db4c92a8db3ed14b579d87854966c781eb3 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Fri, 20 Jan 2017 16:20:23 +0100 Subject: [PATCH 3/4] Remove timer / io callback order --- src/Loop/Driver.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Loop/Driver.php b/src/Loop/Driver.php index 4883d11..c5de3fc 100644 --- a/src/Loop/Driver.php +++ b/src/Loop/Driver.php @@ -19,10 +19,9 @@ abstract class Driver * * One iteration of the loop is called one "tick". A tick covers the following steps: * - * 1. Activate watchers created / enabled in the last tick / before `run`. + * 1. Activate watchers created / enabled in the last tick / before `run()`. * 2. Execute all enabled defer watchers. - * 3. Execute all due timers, each timer only once per tick. - * 4. Execute actionable stream watchers, each only once per tick. + * 3. Execute all due timer and actionable stream callbacks, each only once per tick. * * The loop MUST continue to run until it is either stopped explicitly, no referenced watchers exist anymore, or an * exception is thrown that cannot be handled. Exceptions that cannot be handled are exceptions thrown from an From f648dd50e8008f68f4e5c7a9dd1019dd3a0cd51b Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sun, 22 Jan 2017 17:09:35 +0100 Subject: [PATCH 4/4] Add pending signals to third tick step --- src/Loop/Driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Loop/Driver.php b/src/Loop/Driver.php index c5de3fc..6595ce3 100644 --- a/src/Loop/Driver.php +++ b/src/Loop/Driver.php @@ -21,7 +21,7 @@ abstract class Driver * * 1. Activate watchers created / enabled in the last tick / before `run()`. * 2. Execute all enabled defer watchers. - * 3. Execute all due timer and actionable stream callbacks, each only once per tick. + * 3. Execute all due timer, pending signal and actionable stream callbacks, each only once per tick. * * The loop MUST continue to run until it is either stopped explicitly, no referenced watchers exist anymore, or an * exception is thrown that cannot be handled. Exceptions that cannot be handled are exceptions thrown from an