1
0
mirror of https://github.com/danog/loop.git synced 2024-11-26 20:04:44 +01:00
This commit is contained in:
Daniil Gentili 2022-12-24 19:04:18 +01:00
parent 1544d1fe5b
commit 8309d5be1d
2 changed files with 6 additions and 8 deletions

View File

@ -52,7 +52,7 @@ abstract class Loop
#### loop() #### loop()
The `loop` [async coroutine](https://amphp.org/amp/coroutines/) will be run only once, every time the `start` method is called. The `loop` [async fiber](https://amphp.org/) will be run only once, every time the `start` method is called.
#### __toString() #### __toString()
@ -106,7 +106,7 @@ Pauses the loop for the specified number of milliseconds, or forever if `null` i
#### resume() #### resume()
Forcefully resume the loop from the outside. Forcefully resume the loop from the outside.
Returns a promise that is resolved when the loop is paused again. Returns a future that is resolved when the loop is paused again.
### SignalLoop ### SignalLoop
@ -135,7 +135,7 @@ Signaling can be used as a message exchange mechanism a-la IPC, and can also be
#### waitSignal() #### waitSignal()
Resolve the provided promise or return|throw passed signal. Resolve the provided future or return|throw passed signal.
### ResumableSignalLoop ### ResumableSignalLoop

View File

@ -10,12 +10,14 @@
namespace danog\Loop\Interfaces; namespace danog\Loop\Interfaces;
use Stringable;
/** /**
* Loop interface. * Loop interface.
* *
* @author Daniil Gentili <daniil@daniil.it> * @author Daniil Gentili <daniil@daniil.it>
*/ */
interface LoopInterface interface LoopInterface extends Stringable
{ {
/** /**
* Start the loop. * Start the loop.
@ -27,10 +29,6 @@ interface LoopInterface
* The actual loop function. * The actual loop function.
*/ */
public function loop(): void; public function loop(): void;
/**
* Get name of the loop.
*/
public function __toString(): string;
/** /**
* Check whether loop is running. * Check whether loop is running.
*/ */