Break out of Event Loop

If I have an event loop, that is currently blocked in a wait() call, is there any way for the application to essentially post a message, and break it out of the wait condition?

I noticed in some old documentation that the ifMessagePort interface had a PostMessage() method, but it doesn’t look like that exists anymore.

I think your best bet is to set a non-zero wait time, and check for exit conditions in the “invalid” events.