How can I not wait for response from API call?
I have a big batch of API calls (one depends on other) but application does not need the results. Just say “Facebook do this” and do not wait for response.
How can I not wait for a response?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I was involved in a project a while back where we implemented queuing for something similar to this. (The application was posting to the walls of around 150 pages as well as some other data collection.
Our solution was this:
We had a Queue table that was populated with Jobs. These were made up of the parameters, token and the particular Facebook API call. The table also had a status column that was either set to scheduled/success/fail, a response column and a couple of datetime columns, scheduled & sent.
A script that looked for scheduled jobs, then ran the API calls and collected the response was run by a cron job at an arbitrary interval.
The application itself could look at the Queue table and produce a report of what jobs had been run and their responses, as well as the upcoming scheduled jobs.