Using php I'm trying to figure out the most efficient way to design my web app to incorporate 3rd party API's. The user of the app does not need to see the response from the api call.

So for instance a user will click to send maybe 1000 emails. Those emails will go via someone like SendGrid or Amazon SES. The user does not need to wait until those emails have been processed. Essentially I want those processed in the background with the user returned to the web app.

Should I be thinking of using a queuing service like SES

I have at least three api's I am incorporating.

Thanks

有帮助吗?

解决方案

The most probable way is running some background processes and sending them messages via some queuing solutions like RabbitMq (see also the SlideShare presentation for details). You may also consider using Gearman for distributed computing: make GearmanClient::doBackground() calls from API wrappers, run Gearman job servers as middle points and run workers that actually will make calls to your APIs. See some presentations for further details.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top