uniondrug/tcp-client

Uniondrug Tcp Client Component for uniondrug/framework

Installs: 589

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

pkg:composer/uniondrug/tcp-client

2.0.5 2018-05-09 19:57 UTC

This package is auto-updated.

Last update: 2025-10-09 20:13:51 UTC


README

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)