Module: EF::Loop

Defined in:
lib/event-framework.rb

Overview

provides blocking event loop

Constant Summary collapse

@@thread =
nil

Class Method Summary collapse

Class Method Details

.loopObject

starts the loop



88
89
90
91
# File 'lib/event-framework.rb', line 88

def self.loop
  @@thread = Thread.new
  @@thread.value
end

.threadObject

returns corresponding EF::Thread object
which you can use to add new tasks



96
97
98
# File 'lib/event-framework.rb', line 96

def self.thread
  @@thread
end