What's the correct way to use Guzzle 6 to create pool of asynchronous json requests to send to API endpoints?

后端 未结 2 776
慢半拍i
慢半拍i 2021-01-18 07:07

My objective is to use Guzzle 6 to create a pool of asynchronous requests that PUT json data. Then monitor each $promise success/failure.

For comparison to my POOL c

2条回答
  •  执笔经年
    2021-01-18 07:22

    If you want full control, don't use the Request() object in your Pool. Instead, start the request yourself by having your pool's generator yielding a callable function which starts the request. That gives you total control of all options. Here is a correct code example:

    https://stackoverflow.com/a/40622269/5562035

提交回复
热议问题