phasync\Internal\ChannelBuffered
final
class
Documentation
This is a highly optimized implementation of a bi-directional channel
for communication between coroutines running in the same memory space
without threading. It is not meant to be used directly since it has
no protection against deadlocks. Instead channels should be created
via phasync::channel().
The implementation reaches around 500 000 reads and 500 000 writes between a pair of coroutines on an AMD Ryzen 7 2700X.
Inheritance
Implements:
phasync\Internal\ChannelBackendInterface
IteratorAggregate
phasync\SelectableInterface
Traversable
phasync\WriteChannelInterface
phasync\ReadChannelInterface
Constants (3)
| Name | Value |
|---|---|
READY |
0 |
BLOCKING_READS |
1 |
BLOCKING_WRITES |
2 |
Properties (15)
array $waiting
Waiting readers must be stored here, because if the Channel becomes
WeakMap $timeouts
The timeout for waiting fibers.
int $id
bool $closed
array $buffer
Fiber $creatingFiber
int $state
int $queueFirst
int $queueLast
int $queueFailed
int $bufferSize
int $firstBuffer
int $lastBuffer
Fiber $receiver
object $flag
Methods (19)
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing