Class: Af::QThread::MessageHandler
- Inherits:
-
Object
- Object
- Af::QThread::MessageHandler
- Defined in:
- lib/fiksu-af/q_thread/message_handler.rb
Instance Attribute Summary collapse
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(thread) ⇒ MessageHandler
constructor
A new instance of MessageHandler.
- #process_message(message) ⇒ Object
- #process_messages ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(thread) ⇒ MessageHandler
Returns a new instance of MessageHandler.
5 6 7 |
# File 'lib/fiksu-af/q_thread/message_handler.rb', line 5 def initialize(thread) @thread = thread end |
Instance Attribute Details
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
3 4 5 |
# File 'lib/fiksu-af/q_thread/message_handler.rb', line 3 def thread @thread end |
Class Method Details
.run(thread = Thread.current) ⇒ Object
9 10 11 |
# File 'lib/fiksu-af/q_thread/message_handler.rb', line 9 def self.run(thread = Thread.current) return new(thread).run end |
Instance Method Details
#process_message(message) ⇒ Object
26 27 28 |
# File 'lib/fiksu-af/q_thread/message_handler.rb', line 26 def () return nil end |
#process_messages ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/fiksu-af/q_thread/message_handler.rb', line 17 def while true = thread. break if .data == :terminate response = () .from.(response, thread) end end |
#run ⇒ Object
13 14 15 |
# File 'lib/fiksu-af/q_thread/message_handler.rb', line 13 def run end |