mrlaozhou / core-engine-client
此包的最新版本(dev-master)没有提供许可信息。
core-engine客户端
dev-master
2021-04-28 01:40 UTC
Requires
- ratchet/pawl: ^0.3.5
This package is not auto-updated.
Last update: 2024-09-25 17:02:20 UTC
README
安装
composer require mrlaozhou/core-engine-client
配置
config/coreengine-client.php
<?php return [ // 当前平台的key 'key' => env('CEC_KEY', 'system'), // websocket 地址 'socket-url' => env('CEC_URL', ''), // 端口 'port' => env('CEC_PORT', 9251), // token 'token' => env('CEC_TOKEN', null), ];
使用方法
/** * @param array $payload 载体信息 * @param array $to 发送至 * @param string $order 指令 * * @return \React\Promise\PromiseInterface */ $payload = ['type' => 'txt', 'content' => 'close your eyes .']; $to = [ ['key'=>'crm::2'], ['key'=>'crm::12'] ]; $order = 'receive.approval'; \CoreEngineClient::send( $payload, $to, $order );