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 ;-)

2 Responses to “ColdFusion asynchronous calls (event gateway)”

  1. Geron P Says:

    Please forward me the code so that I can take a look at this. Thanks!


  2. Hi Geron, the code is on the way.


Leave a Reply