hotrush/scrapoxy-react-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hotrush/scrapoxy-react-client

最新稳定版本:1.1.0

Composer 安装命令:

composer require hotrush/scrapoxy-react-client

包简介

Async client for Scrapoxy and ReactPHP

README 文档

README

Build Status Coverage Status StyleCI Version Packagist Downloads SensioLabsInsight

Scrapoxy-React-Client

Async client for Scrapoxy and ReactPHP.

Installation

composer require hotrush/scrapoxy-react-client

Usage

use Hotrush\ScrapoxyClient\Client;
use React\EventLoop\Factory as LoopFactory;

$loop = LoopFactory::create();
$client = new Client('http://scrapoxy-host.com/api/', 'password', $loop);
$loop->run();

Get scaling

$client->getScaling()
    ->then(
        function($scaling) {
            var_dump($scaling);
        },
        function($exception) {
            echo (string) $exception;
        }
    );

Will output your current scaling info:

[
    "min" => 0,
    "required" => 2,
    "max" => 5,
]

Scaling up and down

$client->upScale()->then(...);
$client->downScale()->then(...);

Scaling up will update required instances number to maximum. Scaling down will update it to minimum.

Custom scaling

You can define your custom instances number:

$client->scale([
    'min' => 0,
    'max' => 10,
    'required' => 5,
]);

Get and update config

$client->getConfig()->then(...);
$client->updateConfig([
    'any_key' => 'any_value',
])->then(...);

Get instances

$client->getInstances()->then(...);

Stop instance by name

$client->stopInstance($name)->then(...);

Will throw NotFoundException if instance name not found.

Contribution

You are welcome to create any pull requests or write some tests!

统计信息

  • 总下载量: 70
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固