Ordering of requests

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ordering of requests

mjholgate
Hi,

I've implemented my own UPNP service, and it's important that requests are processed in a predictable order.

To ensure this, I've used synchronized methods on the service side.

However, from a client point of view, if I were to do:

controlPoint.execute(new MyAction1(myService, params)
{
    // override failure/success callbacks
});
controlPoint.execute(new MyAction2(myService, params)
{
    // override failure/success callbacks
})
can I rely upon the service receiving the request for MyAction1 before it receives the request for MyAction2, or is there a potential race condition here?

If so I'd presume I'd have to chain the calls to avoid it, something like:

controlPoint.execute(new MyAction1(myService, params)
{
   public void onSuccess() 
   { 
      controlPoint.execute(new MyAction2(myService, params)
      {
         // override failure/success callbacks
      });
   }
});

thanks

Matt
Reply | Threaded
Open this post in threaded view
|

Re: Ordering of requests

Christian Bauer
Administrator