phanxipang / fansipan

A simple package that allows you to write your API integrations or SDKs in a elegant way.
https://phanxipang.github.io/fansipan
MIT License
86 stars 2 forks source link

Concurency & Pools #5

Open jenky opened 1 year ago

uphlewis commented 12 months ago

The conversation around a PHP Promises PSR dried up years ago, and AFAIK there still isn't a decent client-agnostic abstraction around async HTTP requests or Promises in PHP.

So, I'd also be interested to see how this library could be implemented around a more concrete Client implementation e.g., Guzzle, which provides features such as async/promises or request pools/concurrency.

jenky commented 12 months ago

Hi @uphlewis

Thank you for bringing up the topic. I actually have a repository here that utilizes react/amp/psl to achieve async/pool functions. Although it may not be the optimal approach compared to Guzzle's multi-curl. I would appreciate it if you could give it a try and share your feedback. Your input would be greatly appreciated.

uphlewis commented 12 months ago

Honestly, im probably going to continue to favour guzzle's async implementation in most of my projects, since it's usually already there as a dependency and i really like their promises API.