#ifndef __UserRequestControl_h_ #define __UserRequestControl_h_ /* This module takes care of the real-time data requests. Each refresh request * is sent to this thread. This thread waits until it gets a refresh request * AND enough time has passed, then it sends the request to the database and * sends the results to the user. * * All streaming requests are put in one thread to make sure we are in control * of the system load. If the database is backed up, all requests will wait * in an orderly fashion in a queue. If we have too many users at once, they * will wait their turn in line, and will not block access to the database * from anyone else. * * This module is also responsible for routing history requests. Since all * realtime and historical data goes to the same window, it is important to * keep the requests organized. If, for example we request a little bit of * history followed by the realtime data, but the history request is not ready * in time, then we cancel that request and just start serving the realtime * data. */ bool initUserRequestControl(); #endif