Asynchronous Design Pattern - Scalable TX Pipeline

Asynchronous Design Pattern - Scalable TX Pipeline

am 14.09.2007 21:58:05 von LarryHerbinaux

Can 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

RE: Asynchronous Design Pattern - Scalable TX Pipeline

am 14.09.2007 23:22:01 von LarryHerbinaux

I don't think I can get direct access to the data structure that holds the
connection, but I can restructure it to use the following class,
PageAsyncTask, right?

Is this the best solution for my problem within IIS?

Re: Asynchronous Design Pattern - Scalable TX Pipeline

am 15.09.2007 08:56:59 von David Wang

On Sep 14, 2:22 pm, Larry Herbinaux
wrote:
> I don't think I can get direct access to the data structure that holds the
> connection, but I can restructure it to use the following class,
> PageAsyncTask, right?
>
> Is this the best solution for my problem within IIS?



PageAsyncTask is managed code which sits on top of a managed-code
wrapper called "ASP.Net ISAPI" which translates such actions into
native async IO directives that interact with IIS natively.

IIS and ASP.Net are fully asynchronous. However, they do not expose to
the end-user all four elements of your interface, and they expose
other async IO elements not on your interface.

I believe IIS supports all the asynchronous IO you need. Just not
implemented with the exact same interface as your own TCP Socket
Server. The ISAPI ECB (native code) or ASP.Net HttpContext (managed
code) is your async socket connection abstraction, and async IO calls
all take in context which allow you to associate application data
object to the connection object.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//