Change receiveIsReady and processEvents to return immediately, with comment warnings that the caller needs to sleep to avoid using 100% CPU.