> I'm still thinking about a possible solution using a global queue and a > global > timer (and the timer just resuming queued transactions at pre-defined > internal), but to implement that: > 1. Is it ok to put/store a transaction in an external queue? > 2. Is it safe to not call transaction.resume() in a plugin? (What is the API > I should call to stall the state machine while not tie up the invoking thread?) > 3. What kind of thread/group is safe to be used to call > transaction.continue() asynchronously?
Regarding question 2) It seems the only API that I could use to stall is TSContSchedule. If that's the case, this might still be doable: I can schedule a relative large delay (larger than queue_size * rate-limit interval) using that API, and store the returned handle along with the transaction in the queue. Later when timer fires I would just cancel the scheduled continuation and call transaction.resume() instead. One scenario this won't work is if some other timeout out of our control being imposed on the transaction. What you do think? Is it a possible solution or just my fantasy ^_^?