class Scheduler (View source)

Methods

false|void
add(callable $func, ...$params)

Add a task (implemented in a callback).

false|void
parallel(int $n, callable $func, ...$params)

Add a list of tasks (implemented in callbacks).

void
set(array $settings)

To set runtime configurations of coroutines.

array|null
getOptions()

To get runtime configurations of coroutines.

bool
start()

Start running the list of tasks (callbacks) added through method add() and parallel().

Details

false|void add(callable $func, ...$params)

Add a task (implemented in a callback).

Parameters

callable $func
...$params

Return Value

false|void

Returns FALSE if the scheduler has already been started; otherwise nothing returns.

See also

Scheduler::start

false|void parallel(int $n, callable $func, ...$params)

Add a list of tasks (implemented in callbacks).

Parameters

int $n
callable $func
...$params

Return Value

false|void

Returns FALSE if the scheduler has already been started; otherwise nothing returns.

See also

Scheduler::start

void set(array $settings)

To set runtime configurations of coroutines.

This method is an alias of method \Swoole\Coroutine::set().

Parameters

array $settings

Return Value

void

See also

Coroutine::set

array|null getOptions()

Since: Swoole 4.6.0

To get runtime configurations of coroutines.

This method is an alias of method \Swoole\Coroutine::getOptions().

Return Value

array|null

See also

Coroutine::getOptions

bool start()

Start running the list of tasks (callbacks) added through method add() and parallel().

Return Value

bool

See also

Scheduler::add
Scheduler::parallel