Class: RbEAI::MAIN

Inherits:
GServer
  • Object
show all
Defined in:
lib/rbeai/Main.rb

Instance Method Summary collapse

Constructor Details

#initializeMAIN

Returns a new instance of MAIN.



14
15
16
17
18
19
# File 'lib/rbeai/Main.rb', line 14

def initialize()
  #server_port = 8888
  #server_log = true
  @wflowlist = []
  super(port = @@server_port, host = "localhost", maxConnections = 1, audit = @@server_log)    
end

Instance Method Details

#serve(io) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/rbeai/Main.rb', line 21

def serve(io)
  command = io.gets.strip
  if command == "stop"
    io.puts "Exiting ..."
    stop()
  end    
end

#shutdownObject



41
42
43
44
# File 'lib/rbeai/Main.rb', line 41

def shutdown()
  _endWflows()
  super()
end

#startObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rbeai/Main.rb', line 29

def start()
  files = []
  files = rio("workflows")["*.wf"]
  files.each do |file|
    puts file
    awflow = Workflow.new(File.new(file))
    awflow.run
    @wflowlist << awflow
  end    
  super()
end

#stopObject



46
47
48
49
# File 'lib/rbeai/Main.rb', line 46

def stop()
  _endWflows()
  super()
end