2011-11-24 20:08 阅读 5

等待图api / batch api的结果

how can i set no waiting for response from api call?

I have big batch request (one depends on other) but application do not needs results. Just say "facebook do this" and do not wait for response.

How can i set do not wait for response?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    dthy81285 dthy81285 2011-11-25 09:33

    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.

    点赞 评论 复制链接分享
  • dongzouh51192 dongzouh51192 2011-11-24 23:10

    I believe you are looking for a way to do a async php calls. You may end up with doing some queries by yourself, as I don't think PHP FB SDK support such queries.

    I believe curl_multi (php5 only) is a solution you look for:

    You may also find this QA helpful:

    点赞 评论 复制链接分享