Class: Steep::Server::Master::ResultController

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/server/master.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResultController

Returns a new instance of ResultController.



81
82
83
# File 'lib/steep/server/master.rb', line 81

def initialize()
  @handlers = []
end

Instance Attribute Details

#handlersObject (readonly)

Returns the value of attribute handlers.



79
80
81
# File 'lib/steep/server/master.rb', line 79

def handlers
  @handlers
end

Instance Method Details

#<<(handler) ⇒ Object



85
86
87
# File 'lib/steep/server/master.rb', line 85

def <<(handler)
  @handlers << handler
end

#process_response(message) ⇒ Object



95
96
97
98
99
100
101
102
# File 'lib/steep/server/master.rb', line 95

def process_response(message)
  handlers.each do |handler|
    return true if handler.process_response(message)
  end
  false
ensure
  handlers.reject!(&:completed?)
end

#request_group {|group| ... } ⇒ Object

Yields:

  • (group)


89
90
91
92
93
# File 'lib/steep/server/master.rb', line 89

def request_group()
  group = GroupHandler.new()
  yield group
  group
end