2017 © Pedro Peláez
 

library commercetools-async-pool

Batch-Processing of a pool asynchronous commercetools requests.

image

bestit/commercetools-async-pool

Batch-Processing of a pool asynchronous commercetools requests.

  • Sunday, August 20, 2017
  • by WBLKonzept
  • Repository
  • 2 Watchers
  • 2 Stars
  • 9,098 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 16 Versions
  • 6 % Grown

The README.md

commercetools-async-pool

Batch-Processing of a pool asynchronous commercetools requests., (*1)

Introdction

Commercetools suggests that you use asynchronous requests instead of sequential ones but the PHP SDK makes it not very easy:, (*2)

  1. Promises for Client::executeAsync works on the raw guzzle response, not the "requested object".
  2. Guzzle promise-chaining/forwarding and the AbstractApiResponse from commercetools are not compatible.

So i created a helping pool of async requests. Please review the following information., (*3)

Installation

composer require bestit/commercetools-async-pool

API and Usage

$pool = new Pool($this->getClient());

$pool->addPromise(ProductTypeByIdGetRequest::ofId('example')).then(
    // Success
    function(ProductType $productType) use ($userdata) {          
        echo $productType->getId();
    },
    // optional error callback
    function(ErrorResponse $error) {
        echo $error->getStatusCode();    
    }
);
//.then(/* chained callbacks */)
//.then()
// ....

// Gets flushed automatically, if we overflow the tick rate from the constructor.
$pool->flush();

But beware, do not forget that the callbacks are happening asynchronous! That is no sequential PHP anymore!, (*4)

Future

  • More Unittests

The Versions

20/08 2017

dev-master

9999999-dev

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

20/08 2017

3.1.0

3.1.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

12/05 2017

3.0.0

3.0.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

23/03 2017

2.0.1

2.0.1.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

23/03 2017

2.0.0

2.0.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

22/03 2017

1.0.4

1.0.4.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

22/03 2017

1.0.3

1.0.3.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

25/01 2017

1.0.2

1.0.2.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

25/01 2017

1.0.1

1.0.1.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

25/01 2017

1.0.0

1.0.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Björn Lange

19/01 2017

0.3.0

0.3.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

by Björn Lange

30/12 2016

0.2.3

0.2.3.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

by Björn Lange

30/12 2016

0.2.2

0.2.2.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

by Björn Lange

30/12 2016

0.2.1

0.2.1.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

by Björn Lange

30/12 2016

0.2.0

0.2.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

by Björn Lange

29/12 2016

0.1.0

0.1.0.0

Batch-Processing of a pool asynchronous commercetools requests.

  Sources   Download

MIT

The Requires

 

by Björn Lange