celery / vine

Python promises
Other
124 stars 43 forks source link

Questions: Is there a way to gather results return by promises passed into a barrier? #11

Open xlqian opened 7 years ago

xlqian commented 7 years ago

I'd like to gather results returned by promises that are passed into a barrier, I imagined an interface like this:

        p1 = http.Request('http://a')
        p2 = http.Request('http://b')
        p3 = http.Request('http://c')
        requests = [p1, p2, p3]
        def gather_results(*res): # 
            pass  # all requests complete
        b = barrier(requests).then(gather_results)

Can this be achieved by using the current interface?

Thank you very much