Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I have an actor which is having three asynchronous web service calls. Lets say A,B and C. All return promise objects which has their respective response. I added loggers processA,processB,processC respectively.

Now I use F.Promise.sequence(promiseA, promiseB, promiseC) [Play]and applies some logic by using flatmap and for each [Java]. I added loggers logA, logB and logC respectively.

What would be the order of loggers? will it be like once after complete processing a web service call, the respective operations call ?

Please let me know if any document/ links available to explain the concepts of promise and combining multiple promise through Play F.Promise.sequence.

share|improve this question
    
The official documentation doesn't appear to say anything about side effect ordering, and "added loggers" is far too vague for us to guess or test it ourselves. I believe the APlus promises spec requires promise callbacks to always be called asynchronously, which might be enough to answer your question, but I have no idea if Play implements that spec or not. –  Ixrec Jul 21 at 11:58
    
@lxrec, added loggers is simply like printing something in the console. Written a small program and found that once after completing all async calls, F.Promise.sequence starts executing. –  dhana Jul 22 at 4:54

1 Answer 1

Written a small program and found that once after completing all async calls, F.Promise.sequence starts executing.

For Example, processA, processB and ProcessC are three async calls. Lets say processA completes First and processC completes second and processC finishes third. The console would be

processA processC processB

But when we consolidate all these promises

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.