A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mix-php/sync-invoke below:

mix-php/sync-invoke: Swoole synchronous blocking code invoke library

Mix Sync Invoke

Swoole 同步阻塞代码调用库,用于执行无法被 Swoole Hook 协程化的同步阻塞代码

Usage
composer require mix/sync-invoke

创建服务器,用于执行同步代码,第二个参数为 true 可复用端口

$server = new \Mix\SyncInvoke\Server(9505, true);
$server->start();
$dialer = new \Mix\SyncInvoke\Client\Dialer();
$client = $dialer->dial(9505);
$data   = $client->invoke(function () {
    $obj = new Hello();
    return [1, 2, 3, $obj];
});
var_dump($data);
License

Apache License Version 2.0, http://www.apache.org/licenses/


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4