TcpClient component for uniondrug/framework
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
README.md
composer.json

README.md

TCPClient component for uniondrug/framework

Uniondrug微服务基于TCP的客户端的封装,加入了Trace功能。

安装

$ cd project-home
$ composer require uniondrug/tcp-client

修改 app.php 配置文件,导入服务。服务名称:tcpClient

return [
    'default' => [
        ......
        'providers'           => [
            ......
            \Uniondrug\TcpClient\TcpClientServiceProvider::class,
        ],
    ],
];

使用

    // 在 Injectable 继承下来的对象中:
    $data = $this->getDI()->getShared('tcpClient')->get($url);

    // 或者 直接使用 属性方式
    $data = $this->tcpClient()->get($url)