Hi, list! Is it possible to implement WSAPI service that does as follows?
1. There is a blocking function: get_events() It fetches from DB a list of unprocessed events, tagged by used ID: { { id = 1, "data1" }, { id = 42, "data2" }, { id = 42, "data3" } } It blocks execution if there are no events. 2. Clients (thousands at the same time) connect by HTTP to the wsapi service and ask for events: GET http://example.com/events?id=42 3. If no events for a given ID are available, server blocks until a suitable event appears. (If connection timeouts, client simply reconnects.) For the sake of simplicity, let's say that if the client was not connected when his event was processed, the event is lost. The problem here is to avoid worker starvation. As I understand, in the naïve implementation, one blocking client would block whole process. Any clues? Alexander. P.S. Please CC me when replying. Thanks! _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/