ColdFusion asynchronous calls (event gateway)
February 1, 2008
Do you have some methods that require lots of processing, but don’t want the customer to have to wait for the result? I’ve programmed a cool event gateway today, very simple, but it allows you to pass an object to it, the method to call, and the arguments.
Anyone interested in the component, just leave a comment with your details and I’ll forward you a copy of the code.
The code to make the asynchronous call is as following:
<cfscript>
myData = structNew();
myData.object = request.new( “Test” ).init(); // creates a new object
myData.methodName = “test”; // the name of the method to call on the object
myData.argumentCollection.ipAddress = cgi.REMOTE_ADDR; // the arguments to pass
sendGatewayMessage( “ASynchronousCall”, myData ); // make the asynchronous call
</cfscript>
It’s that easy, very powerfull and saves your customers from waiting on processing that can be done behind the scenes and requires no response to be returned to screen.
Any questions, just ask




February 21, 2008 at 7:41 pm
Please forward me the code so that I can take a look at this. Thanks!
February 21, 2008 at 9:48 pm
Hi Geron, the code is on the way.