We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recently I made a inter-thread event emitter based on the event_emitter_fast. And I tested, feeling comfortable.
Please please please give me some advice!!
The modified event emitter for inter-thread communication purpose: Here
Usage:
void thread_run(handler *&H) { handler h; H = &h; h.on("key-enter", []() { printf("thread: Enter pressed\n"); }); h.on("key", [](int ch) { printf("thread: pressed %c\n", ch); }); printf("MessageQueue started\n"); h.loop(); printf("MessageQueue exited\n"); } int main() { handler *H = nullptr; std::thread thread(thread_run, std::ref(H)); int ch = 0; while ((ch = getchar()) != 'q') { if (ch == '\n') { H->emit("key-enter"); } else { H->emit("key", ch); } } H->quit(); thread.join(); }
This would probably fix #33 Thanks!!!!!!!!!!!!!!!!! @mikecovlee @shirakamiemmmer
The text was updated successfully, but these errors were encountered:
mikecovlee
No branches or pull requests
Recently I made a inter-thread event emitter based on the event_emitter_fast.
And I tested, feeling comfortable.
Please please please give me some advice!!
The modified event emitter for inter-thread communication purpose: Here
Usage:
This would probably fix #33
Thanks!!!!!!!!!!!!!!!!!
@mikecovlee @shirakamiemmmer
The text was updated successfully, but these errors were encountered: