class WaitConcurrent extends Concurrent

Properties

protected Channel $channel from  Concurrent
protected WaitGroup $wg

Methods

__construct(int $limit)

No description

mixed
__call(string $name, array $arguments)

Proxy isFull() and isEmpty() to the channel.

int
getLimit()

Get the concurrency limit.

int
length()

Get the current number of running coroutines.

int
getLength()

Get the current number of running coroutines.

int
getRunningCoroutineCount()

Get the current number of running coroutines.

getChannel()

Get the underlying channel.

void
create(callable $callable)

Create a new coroutine with concurrency limiting and wait tracking.

void
fork(callable $callable, array $keys = [])

Create a new coroutine with parent context propagation and wait tracking.

bool
isFull()

No description

bool
isEmpty()

No description

bool
wait(float $timeout = -1)

Wait for all coroutines to complete.

Details

at line 17
__construct(int $limit)

No description

Parameters

int $limit

in Concurrent at line 31
mixed __call(string $name, array $arguments)

Proxy isFull() and isEmpty() to the channel.

Parameters

string $name
array $arguments

Return Value

mixed

Exceptions

InvalidArgumentException

in Concurrent at line 43
int getLimit()

Get the concurrency limit.

Return Value

int

in Concurrent at line 51
int length()

Get the current number of running coroutines.

Return Value

int

in Concurrent at line 59
int getLength()

Get the current number of running coroutines.

Return Value

int

in Concurrent at line 67
int getRunningCoroutineCount()

Get the current number of running coroutines.

Return Value

int

in Concurrent at line 75
Channel getChannel()

Get the underlying channel.

Return Value

Channel

at line 27
void create(callable $callable)

Create a new coroutine with concurrency limiting and wait tracking.

Parameters

callable $callable

Return Value

void

at line 53
void fork(callable $callable, array $keys = [])

Create a new coroutine with parent context propagation and wait tracking.

Parameters

callable $callable
array $keys

Context keys to copy (empty = all keys)

Return Value

void

at line 13
bool isFull()

No description

Return Value

bool

at line 13
bool isEmpty()

No description

Return Value

bool

at line 80
bool wait(float $timeout = -1)

Wait for all coroutines to complete.

Parameters

float $timeout

Timeout in seconds (-1 for unlimited)

Return Value

bool

True if all completed, false if timed out