11 Dec
2010
11 Dec
'10
1:03 p.m.
2010/12/11 Dave Zarzycki <zarzycki@apple.com>
You would not want to implement a stream of keyboard events with an "is level" dispatch source. This is because users expect that keyboard events are not lossy, and a dispatch "is level" source would only tell your code what the last key press was, not the list of key presses that haven't been handled yet. A dispatch queue would be appropriate in this scenario.
Yeah, you are right, I didn't consider it thoroughly, sorry. But I still think we need such custom sources: in some cases like fire multi-times and will only process the last value (like threading.Event<http://www.python.org/doc//current/library/threading.html#threading.Event>API in python). -- Regards, - cee1