2017 © Pedro Peláez
 

library scrapoxy-react-client

Async client for Scrapoxy and ReactPHP

image

hotrush/scrapoxy-react-client

Async client for Scrapoxy and ReactPHP

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Build Status Coverage Status StyleCI Version Packagist Downloads SensioLabsInsight, (*1)

Scrapoxy-React-Client

Async client for Scrapoxy and ReactPHP., (*2)

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:, (*3)

[
    "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., (*4)

Custom scaling

You can define your custom instances number:, (*5)

$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., (*6)

Contribution

You are welcome to create any pull requests or write some tests!, (*7)

The Versions

10/04 2018

dev-master

9999999-dev

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

10/04 2018

1.1.0

1.1.0.0

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

27/03 2017

1.0.4

1.0.4.0

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

27/03 2017

1.0.3

1.0.3.0

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

27/03 2017

1.0.2

1.0.2.0

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

14/03 2017

1.0.1

1.0.1.0

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

14/03 2017

1.0.0

1.0.0.0

Async client for Scrapoxy and ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires