문제

Currently I am using GPars Agent class to process typical shopping cart scenario. I have a situation where I need to wait for addtocart, minicart tasks to complete before viewcart task returns response. The webservice call returns viewcart before returning addtocart/minicart. How do I let Agent class know to process the viewcart after other tasks are completed?

도움이 되었습니까?

해결책

Agents always process submitted tasks sequentially. So if you submit the viewcart task last, it will be processed last. You may call agent.await() of agent.val to block the caller until all so-far-submitted tasks have been completed.

다른 팁

Vaclav Pech,

Thank you much. Appreciate your help. I have handled this scenario adding a counter before(increment counter) and after(decrement counter) the service and waiting for the items to be processed in the View cart and redirect them to viewcart page. Just wanted to add my answer to this thread.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top