phasync\Drivers\StreamSelectDriver
final
class
Documentation
Inheritance
Implements:
phasync\Drivers\DriverInterface
Countable
Constants (4)
| Name | Value |
|---|---|
STREAM_READ |
1 |
STREAM_WRITE |
2 |
STREAM_EXCEPT |
4 |
SUSPEND_TICK |
0 |
Properties (21)
SplQueue $queue
Holds the queue of fibers that will be activated on the next
WeakMap $contexts
Holds a reference to all Fiber that are created by this driver.
SplObjectStorage $pending
Holds a reference to all fibers that will be resumed by this event
WeakMap $parentFibers
Maps child fibers to their parent fibers, unless the fiber
WeakMap $fiberExceptionHolders
Exceptions to be thrown inside a fiber, or exceptions that
WeakMap $fiberExceptions
When an exception is caught from the exception holder, it is
phasync\Internal\Scheduler $scheduler
A min-heap that provides fast access to the next fiber to be
WeakMap $streams
All fibers suspended waiting for IO.
WeakMap $streamResults
The most recent stream select result for a fiber.
WeakMap $flaggedFibers
Holds a reference to fibers that are waiting for a flag to be
float $lastTimeoutCheck
The time of the last timeout check iteration. This value is used
float $lastIdleRun
The time that we last activated tasks waiting for idle. Tasks waiting
WeakMap $flagGraph
This WeakMap traces which flag a fiber is waiting for.
bool $shouldGarbageCollect
True if cyclic garbage collection should be performed.
SplQueue $callbackQueue
Callbacks to be invoked between fibers.
float $lastGarbageCollect
The time since the last garbage collect cycles invoked.
phasync\Context\ServiceContext $serviceContext
stdClass $idleFlag
stdClass $afterNextFlag
Fiber $currentFiber
phasync\Context\ContextInterface $currentContext
Methods (27)
Create a new StreamSelectDriver instance.
Documentation missing
Returns the full internal state of the driver for debugging purposes.
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Returns true if `$fiber` is blocked by `$flag`. If `$flag` is a
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Removes a fiber from the event loop completely, without throwing any exception.
Gets the exception for a terminated fiber and returns the ExceptionHolder instance
Returns the fiber that is currently being executed by the driver.
Returns the context of the currently executing fiber.
Scans pending fibers and cancels any that have exceeded their timeout.
To ensure that no exceptions will be lost, an ExceptionHolder class is used.
Whenever a fiber is terminated, this method must be used. It will ensure that any