
Hi, I am considering integrating pion-net into an existing application but have a very specific requirement which I would like help understanding whether pion-net supports.
I know it supports pipelining on the HTTP interface. I need it to allow similar behaviour on the Application interface. When pion receives requests across a TCP connection I need my application using pion to be given access to all of them even if it has not responded to previous requests. There is a latency in my system in processing a request which means handling them sequentially would cripple the throughput requirements I have.
Note: These requests are across a single TCP connection. I need my application to receive request #2 even if it has not responded to request #1. The latency I refer to is internal to my system not in the IP network and is on account of an internal message passing environment. My system is required to handle thousands of requests a second.
I would be very grateful for your help
Best Regards

That's certainly an intriguing problem..
Normally one would chain together HTTPRequestReader's and HTTPResponseWriter's to create an asynchronous pipeline that incrementally handles each request individually. The HTTPRequestReader's callback basically just creates an HTTPResponseWriter whose callback is to create and trigger a new HTTPRequestReader, etc. This is basically what the HTTPServer class does.
In theory at least, you could have an globally-accessible object ("ResponseSender") that contains a TCPConnectionPtr and a queue of HTTPResponsPtr's. Your HTTPRequestReader callback function would just create an asynchronous work item that upon completion pushes a new HTTPResponsePtr into the RequestSender's queue. Then, it would create a new HTTPRequestReader and immediately start parsing the next request.
- Login or register to post comments
Submitted by Mike Dickey on Mon, 04/05/2010 - 10:23.