OpenSwoole\Server->set

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

Declaration

<?php OpenSwoole\Server->set(array $settings)

Parameters

settings

Check the full list of OpenSwoole server configurations that can be used with this method

Return

success

if success, it returns TRUE, otherwise it returns FALSE.

Description

Set the runtime settings of the OpenSwoole server. Settings can be accessed by $server->setting when the OpenSwoole server has started.

You can only use this method before the server has started, cannot be used before the call to $server->start().

Example

<?php
$server->set([
    'reactor_num' => 2,
    'worker_num' => 4,
    'backlog' => 128,
    'max_request' => 50,
    'dispatch_mode' => 1,
]);

Configuration

Checkout the full list and documentation for each server configuration. These options can be set using this method.

Last updated on September 1, 2022