Any concrete suggestions or examples? My weak attempts at polling a flag set by the onReady handler synchronously and asynchronously do not work as intended. Synchronously (blocking) leads to the onReady event never firing, resulting in a deadlock. Asynchronously the timeout problem persists, which is probably some error on my part.

Would it somehow be possible to have a callback as argument to onReady, so it could bind the _flush function properly, and have a dummy function until then and some possible logic on the client side that understands the NOT_READY response?