Вопрос

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