Swoole\Coroutine::disableScheduler ()

Notice: the documentation is suitable for PHP extension swoole until v4.7.1, we only support PHP extension openswoole from v4.7.1

Declaration

<?php
Swoole\Coroutine::disableScheduler ()

Parameters

Return

cid

Current coroutine ID.

Description

Disable preemptive scheduler.

It is the same as ini_set("swoole.enable_preemptive_scheduler", "0");.

Example

<?php
Swoole\Coroutine::disableScheduler();
Co\run(function () {
    // 
});