Asynchronous Design Pattern - Scalable TX Pipeline
am 14.09.2007 21:58:05 von LarryHerbinauxCan someone give me a link to some documentation or explain how I can
implement an asynchronous design pattern to handle a TX request that is
received by IIS?
I would like to be able to free the thread in the thread pool handling the
request while my TX Pipeline is processing I/O (e.g. going to the database,
socket connection to an external supplier). I have an idea on how to
implement the TX Pipeline itself, but I'm not sure how to basically setup the
asynchronous relationship between IIS and my application code so that I can
callback in and access the connection to write the response back to the
client.
Currently our platform processes TXs on three different conduits: HTML, XML,
and Custom Application Data Protocol to handle transactions with POS
Terminals. The first two conduits use IIS as its application. The third
uses a windows service where I have implemented an asynchronous TCP Server.
The TCP Server has a hashtable of Client Connections which contains objects
that encapsulate a socket and also a pointer to an application object that
implements an interface that handles OnAccept, OnReceive, OnDisconnect, and
OnTimeout. It is very easy to implement an Asynchronous TX Pipeline within
the application object; I just implement a state machine and have a callback
which is called when an I/O task finishes. The application object hangs
around because it is references by the object that encapsulates socket which
is stored in the hash table of the TCP Server.
I basically just need to know how to perform the same association of an
application object to the data structure that encapsulates the socket
connection in IIS so that I can communicate back to the client. I believe
this is possible, but haven't found the documentation yet.
Thanks,
Larry