Skip to content

Instantly share code, notes, and snippets.

@mitoop
Last active April 25, 2021 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitoop/f25aa565a9a119e34a9e3c32692fcdc9 to your computer and use it in GitHub Desktop.
Save mitoop/f25aa565a9a119e34a9e3c32692fcdc9 to your computer and use it in GitHub Desktop.
Guzzle async requests
  1. guzzle的异步请求并不是真正的异步
  2. guzzle请求默认使用异步, 同步操作也是异步, 然后 wait,这么做在调用逻辑上统一
  3. 直接使用异步请求没有并没有什么作用(不是想象中的异步), 完全可以用同步代替, 异步请求可以在并发请求时候使用

https://docs.guzzlephp.org/en/stable/quickstart.html#async-requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment