0
<?php

use Hyperf\Pool\SimplePool\PoolFactory;
use Swoole\Coroutine\Http\Client;

$factory = $container->get(PoolFactory::class);

$pool = $factory->get('your pool name', function () use ($host, $port, $ssl) {
    return new Client($host, $port, $ssl);
}, [
    'max_connections' => 50
]);

$connection = $pool->get();

$client = $connection->getConnection(); // 即上述 Client.

// Do something.

$connection->release();

var_dump($connection->check());结果为true;请问此处Do something是直接使用DB::table()即可嘛?链接池建立以后直接使用池里的资源嘛,菜鸟在此先谢过了### 问题描述

summer 0
12月2日提问
0 个回答

撰写答案

推广链接