I'm having problems creating a synchronous background process.
The code sends an (asynchronous) event gateway message to an event gateway. The event gateway cfc then stores the event (stored as some struct object) in a queue (an array).
I then have another event gateway which i initiate manually which processes the queue, handling each event in order, and in the absence of an event then in waits (using <cfthread action="sleep"..) a few seconds before checking the queue again. The problem is that this 2nd event gateway keeps timing out. I read that i can give the event gateway a timeout for it's request, firstly how do i do this? .. and secondly is that the correct way? I also tryed using <cflock> but that also timeouts out even if i set it a timeout, i guess because whilst the cflock doesn't timeout, the timeout for the event gateway request times out before.
A side note, it's really supposed to be an ongoing background process so ideally want to give it an infinite timeout, and start and stop it via the CF administrator.
Something doesn't feel right so i ask am i going about this the wrong way? If so can you suggest any better solutions to acheive what i'm trying to do?