OpenSwoole\Coroutine::disableScheduler ()

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\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 () {
    //
});
Last updated on September 1, 2022