I'm creating a desktop application that requires authorization from a remote server before performing certain actions locally. 
What's the best way to have my desktop application notified when the server approves the request for authorization? Authorization takes 20 seconds average on, 5 seconds minimum, with a 120 second timeout.
I considered polling the server ever 3 seconds or so, but this would be hard to scale when I deploy the application more widely, and seems inelegant. 
I have full control over the design of the server and client API. The server is using web.py on Ubuntu 10.10, Python 2.6.
Does the remote end block while it does the authentication? If so, you can use a simple select to block till it returns.
Another way I can think of is to pass a callback URL to the authentication server asking it to call it when it's done so that your client app can proceed. Something like a webhook.
How can my desktop application be notified of a state change on a remote server?