Guzzle在游泳池得到结果

时间:2017-07-06 10:30:03

标签: php guzzle6

我正在使用Guzzle异步池,但似乎文档中缺少如何使用池来获取返回值?

根据文件:

$pool

如何使用.parent { display: flex; } .table { display: flex; flex-direction: column; box-shadow: 0 20px 30px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); background: lightgrey; } .table:nth-child(2) { z-index: 2; } .table:nth-child(3) { z-index: 3; } .table > div { display: flex; flex-direction: row; } .cell { box-sizing: border-box; display: flex; height: 60px; width: 200px; border-bottom: 1px solid grey; } .cell--head { height: 60px; position: relative; } .cell--logo { background-color: #E96165; color: #fff; padding: 0; height: 60px; display: flex; align-items: center; justify-content: center; } .cell--head > div { padding-top: 30px; } .cell > div { flex: 1; text-align: center; border-left: 1px solid grey; padding: 20px; } .cell > div:first-of-type { border-left: 0; } .label { position: absolute; top: -2px; background: black; color: white; transform: translate(-50%, 0%); left: 50%; padding: 5px; font-size: 10px; }来消费所有回复?

1 个答案:

答案 0 :(得分:0)

使用Pool::batch()方法。还要考虑限制并发以避免一次触发100个请求......

$responses = Pool::batch(
    $client,
    $requests(100),
    ['concurrency' => 5]
);