开发者

is there any way to determine the order of response in the batch response?

开发者 https://www.devze.com 2023-03-06 03:09 出处:网络
I have a question regarding to batch response. If I query home of 20 different users(A, B,C, D,etc..) in one batch request, is there any guarantee that the response of batch will be the.

I have a question regarding to batch response.

If I query home of 20 different users(A, B,C, D,etc..) in one batch request, is there any guarantee that the response of batch will be the. same order of the batch request (A, B,C, D,etc..)?

Because if the res开发者_如何学编程ponse order is different from the request order of users, then there is a BIG problem for my application.

or any other way that I can know which response belongs to which users, etc?

Is is safe enough using by specifying dependencies between operations in the request (for each users)? any better solutions?

Regards, Grace


Actually I think order is guaranteed, because otherwise how would you even match up your results to your requests? See this comment:

Graph Batch API

The docs just state the requests may be executed in an arbitrary order on the server. Your responses will always be in the same order, guaranteed. The whole batch concept makes no sense if not. The execution order on the server matters when the batched requests are dependent on each other in any sense. And there's a graph semantic for expressing that too. – Zahan M Sep 2 '11 at 5:01


This is probably a question that could be better answered in the facebook developers forum, but reading the documentation, it looks like the order is not guaranteed:

By default, the operations specified in the batch API request are independent - they can be executed in arbitrary order on the server and an error in one operation does not affect execution of other operations.

You could force an execution order by using dependencies (as explained in the same page), but I would rather rethink how you handle the responses instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消