Support the ongoing development of Laravel.io →
posted 1 year ago

Hey folks,

I'm working on an app that makes a longer-running (couple of seconds) HTTP request from a controller upon user action (e.g. the user clicks a button, it then triggers a livewire action which does an external HTTP request). My concern is that I'm blocking a process with this and that it wouldn't scale well. What's the best practice here? Is there an async option, or should I maybe turn this into an artisan command and spawn it as an async process?

Thanks in advance

0

For clarification: if it was Go, I'd be using a goroutine, and if it was Python, I'd use aiohttp - that's the kind of solution I'm potentially looking for.

0

Also, I was thinking that eventually as it scales I'll need to respect the external API's rate limit, so maybe the best way is to already turn this into a job with a worker pool. I'm new to Laravel, and I'm not sure if this is the canonical way.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Csaba Okrona ochronus Joined 16 Feb 2024

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.