QueueReader QuickStart Tutorial: Let's jump right in! Create a new QueueReader called `qr' ---------------------------- QueueReader clone qr Place a request on the queue ------------------- qr queue Hello there! How many requests are pending? ------------------------ qr pending Process the next request -------------- qr doNext `Hello there!' appears on stdout. This is the default action for a QueueReader. Process the next n requests -------------- qr doNext 5 Will do at most 5 more requests. Will stop if the queue becomes empty. Process all the requests from the queue -------------- qr flushQueue Note: When you use flushQueue, you can stop the processing by doing qr stop The processing will stop after the current request is completed. Modify the processing of a request ---------------- qr editMethod performRequest What can I say? You start with the contents of the request (which are stored in a file), and you respond to those contents as required. Some possibilities: leave the method as it is. Just pipe the QueueReader output to another application. send the request content to an Offsider as a message send the request content to a language interpreter, like /bin/sh treat the request contents as pure data for specific processing, for example the request contains a gif, convert it to a jpeg. You can also run the QueueReader as a daemon ------------------- qr status qr start qr stop WARNING: Don't start multiple processing streams. For example, if you do qr flushQueue and qr start at the same time, you will end up with undefined behaviour. Choose which processing mode you are using, and stick to that. Specifying a co-daemon -------------------- When running as a daemon, you can specify a co-daemon. In other words, you can arrange for the output of the daemon to be piped to another process pipeline. For example qr pipeDaemonTo: /bin/sh qr start Now, the output from each request (which by default is the contents of the request) will be piped to /bin/sh. Note, however, that it is not a new shell for each request, but the same shell which continues to run for all requests. qr queue cd /home qr queue pwd qr queue ls What next? ------------ That is enough to get you started. There is really not a much more to it. The hard part is deciding when it is appropriate to use a QueueReader, what your QueueReader needs to do, and what format the requests should take. Once those decisions are made, the rest usually follows. Don't be afraid to experiment, if everything goes wrong, just destroy your QueueReader and start again: qr destroyCompletely I suggest you familiarise yourself with Offsiders, (that is where all the flexibility and power comes from), and the QueueReader methods. cheers, Glen