Class: ZooMQ::Console
- Inherits:
-
Object
show all
- Defined in:
- lib/zoomq/console.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Console.
13
14
15
16
|
# File 'lib/zoomq/console.rb', line 13
def initialize
ZMachine.logger = $log
Thread.new { zmachine }
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/zoomq/console.rb', line 26
def method_missing(name, *args, &block)
result = nil
df = @client.send(name, *args, &block)
df.callback { |response| result = response }
df.errback { |error| result = error }
while result.nil?
sleep(0.1)
end
result
end
|
Instance Method Details
#run ⇒ Object
22
23
24
|
# File 'lib/zoomq/console.rb', line 22
def run
Ripl.start(binding: binding)
end
|
#zmachine ⇒ Object
18
19
20
|
# File 'lib/zoomq/console.rb', line 18
def zmachine
ZMachine.run { client }
end
|