Server: implement a simple Waiter class to simplify long-polling