Module: Bowline::Desktop::Runtime
- Defined in:
- lib/bowline/desktop/runtime.rb
Instance Method Summary (collapse)
-
- (Object) main(method = nil, &block)
Run block/method in main thread.
- - (Boolean) main_thread?
-
- (Object) setup!
:nodoc:.
Instance Method Details
- (Object) main(method = nil, &block)
Run block/method in main thread
12 13 14 15 16 17 18 19 |
# File 'lib/bowline/desktop/runtime.rb', line 12 def main(method = nil, &block) proc = method||block if main_thread? proc.call else procs << proc end end |
- (Boolean) main_thread?
22 23 24 |
# File 'lib/bowline/desktop/runtime.rb', line 22 def main_thread? Thread.current == Thread.main end |
- (Object) setup!
:nodoc:
6 7 8 |
# File 'lib/bowline/desktop/runtime.rb', line 6 def setup! #:nodoc: Desktop.on_tick(method(:poll)) end |