[ic] Forking processes
Jonathan Clark
jonc at webmaint.com
Thu Jan 13 19:13:53 EST 2005
> > System particulars: O/S RH 2.4.21-27.0.1.ELsmp, IC 5.2.0, Perl 5.8.5
> >
> > I am looking for a way to solve a process waiting problem. The process
> > I need to call is a web service running on a windows 2003 server. Right
> > now I call the web service from the receipt.html page as a user defined
> > function, but many times the web service takes too long and the receipt
> > page doesn't show quickly enough causing customers to double hit the
> > submit button. I would like to be able to call the web service and then
> > not wait for the response so the receipt page displays quickly. I don't
> > need a response from the web service.
>
> I suggest to call the webservice from a (cron) job instead of from the
> receipt page.
Yep, detach it from the order process altogether.
Using the Jobs feature of Interchange you can write a file in ITL to look
for new orders in the transactions table and process your call to the remote
server, then update a flag or the order status in the transactions table to
indicate a successful call.
Test your job by placing it in the pages directory while you work on it,
then move to say etc/jobs/orderupdate when its finished.
To get your IC job to run, you then add a few directives to the catalog.cfg:
Jobs base_directory etc/jobs
Jobs log logs/jobs.log
and maybe:
Jobs MaxLifetime <max life in seconds>
if your jobs may take a _really_ long time, the default is 600 seconds.
and then call from cron with:
/path/to/interchange/bin/interchange --jobgroup=orderupdate --runjobs=catalo
gname
good luck!
Jonathan.
--
Jonathan Clark
Managing Director,
Webmaint.com - Building Clever Websites http://www.webmaint.com
Webmaint.net - Business Web Hosting http://www.webmaint.net
Cartridge SAVE - Printer Consumables Online
http://www.cartridgesave.co.uk
WireTel - Internet Connectivity Solutions http://www.wiretel.net
More information about the interchange-users
mailing list