#ifndef __MiscThread_h_ #define __MiscThread_h_ /* This class takes an XmlNode, formats it, and sends it out to the client. * * This was extracted from UserRequestControl.C and moved to its own thread * because it was taking too long. In particular, a lot of database threads * were sitting idle while requests were late. UserRequestControl.C was too * busy doing work to do a good job of dispatching work to other threads. * * The word "Misc" is used optimistically. The DeferredXmlReply could be * used in other places. And we may find other, unrelated, work which just * needs to be moved to another thread. That could easily be added to this * thread. * * If you are looking at adding more functionality to this thread, * consider using ../shared/NewWorkerCluster.h instead. After * several attempts that seems to be the best generic worker thread cluster. */ #include "../shared/Messages.h" #include "../shared/XmlSupport.h" class DeferedXmlReply : public Request { public: XmlNode _node; ExternalRequest::MessageId _messageId; void doWork(); void send(); DeferedXmlReply(SocketInfo *socket) : Request(socket) { } // This will destroy the original node using swap(). static void send(SocketInfo *socket, XmlNode &node, ExternalRequest::MessageId messageId); }; void initMiscThread(); #endif