Closed lidaobing closed 6 months ago
Currently, the only way to consume corethread event is registering callback on CoreThread.signalEvent. Example:
CoreThread.signalEvent
https://github.com/iptux-src/iptux/blob/cf49769a0bb62e2deb63d23df115a508608dbde2/examples/count-bot/main.cpp#L47-L48
But it's not suitable for UI(which has its own mainloop). so we need to use an adaptor to queue it in the mainloop, which make things too complex. Example:
https://github.com/iptux-src/iptux/blob/cf49769a0bb62e2deb63d23df115a508608dbde2/src/iptux/EventAdaptor.cpp#L26-L29
we need to add some methods to corethread, to make the consumer easier to write.
CoreThread.CountEvent CoreThread.HasEvent CoreThread.PopEvent
Currently, the only way to consume corethread event is registering callback on
CoreThread.signalEvent
. Example:https://github.com/iptux-src/iptux/blob/cf49769a0bb62e2deb63d23df115a508608dbde2/examples/count-bot/main.cpp#L47-L48
But it's not suitable for UI(which has its own mainloop). so we need to use an adaptor to queue it in the mainloop, which make things too complex. Example:
https://github.com/iptux-src/iptux/blob/cf49769a0bb62e2deb63d23df115a508608dbde2/src/iptux/EventAdaptor.cpp#L26-L29
we need to add some methods to corethread, to make the consumer easier to write.