-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSR-7? #6
Comments
See #2. |
Why is PSR-7 problematic for async? Supporting non-CGI use cases was one of the key reasons we made the interfaces immutable. Diactoros may be problematic for async. That wouldn't surprise me at all, actually, since it was optimized for CGI-server environments (like Zend, Symfony, Drupal, etc.) But Guzzle, for instance, has their own PSR-7 implementation and they do some async things as well, as an HTTP client. It may just take more boilerplate repetition, or factoring some of the sharable boilerplate out of Dicatoros (which I'd love to see happen, actually; there's lots of traits that could be hosted by FIG and shared by everyone). |
Guzzle is able to perform multiple requests simultaneously and consume the results as they are available, but once a requests completes, reading from that request is synchronous. Guzzle is a pseudo-asynchronous way of performing HTTP requests. Guzzle uses PSR-7 works for Guzzle because operations on streams of a completed request may be synchronous. However, while blocking on a stream read, no other completed requests can be handled. Icicle is designed to be asynchronous (non-blocking) at all times. It is imperative that nothing blocks the main thread. @CoderStephen and I are working on a Concurrency package that will allow an Icicle process to spawn threads or fork to perform blocking tasks. I'm closing this issue in favor of #2 so the conversation does not become fragmented. |
The Message component interfaces looks an awful lot like PSR-7's interfaces. I'm sure that's not coincidental. 😄 Is there a reason to not just use the PSR-7 interfaces? Or is it just that no one has gotten around to switching it over yet?
The text was updated successfully, but these errors were encountered: