Hi Rick. I'm using file based messaging, which (I think) uses a polling-for-messages loop to check for new messages to reply to.
I think of this as being like the event loop in windows or in a browser.
Is there any way to hook into this loop, so that I can execute a function the next time it polls for message, especially if there are no messages waiting?
- I want to reply to the web call (API rest call) first. A bit later, when the server is idle, I would like to send an email, or maybe do some else that won't affect the response, but might take a bit longer.
This would be similar to the NEXTTICK function in Vue.Js
Thanks.
You can in File based messaging, but not in COM. File based uses a timer that checks for messages on disk and you can use BINDEVENT() to bind to the timer's tick events.
But... that only works in file based messaging - in COM the server just sits and waits for the next request.
You can intercept when a request comes in in the YourServer::ProcessHit() method which is the better way to probably do this, or if you need something more frequent or more consistent, run your own timer in the background.
+++ Rick ---