Skip to content
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

Http Pool results should maintain original order of requests #37774

Closed
lukeb opened this issue Jun 22, 2021 · 1 comment
Closed

Http Pool results should maintain original order of requests #37774

lukeb opened this issue Jun 22, 2021 · 1 comment

Comments

@lukeb
Copy link
Contributor

lukeb commented Jun 22, 2021

  • Laravel Version: 8.47.9
  • PHP Version: 8.0.2
  • Database Driver & Version:

Description:

The responses from Http::pool should remain in the order that they were added to the pool.
When adding to the pool with as('string'), the responses are reordered by key alphanumerically.
This is not the desired outcome, since it is expected that they are in the same order.

Steps To Reproduce:

$responses = Http::pool(fn (Pool $pool) => [
    $pool->as('luke')->get('https://onjax.com/team/luke-brookhart'),
    $pool->as('brian')->get('https://onjax.com/team/brian-lopresto'),
    $pool->as('alison')->get('https://onjax.com/team/alison-brookhart'),
    $pool->as('chris')->get('https://onjax.com/team/chris-ruggiero'),
]);

dd(array_keys($responses));

Expected results

['luke','brian','alison','chris']

Actual results

['alison','brian','chris','luke']

@driesvints
Copy link
Member

seems like a feature request. I see you already sent in a PR 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants