Class: Rbgo::Actor
- Inherits:
-
Object
- Object
- Rbgo::Actor
- Defined in:
- lib/rbgo/actor.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
Returns the value of attribute handler.
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
-
#initialize(&handler) ⇒ Actor
constructor
A new instance of Actor.
- #send_msg(msg) ⇒ Object
Constructor Details
Instance Attribute Details
#handler ⇒ Object
Returns the value of attribute handler.
12 13 14 |
# File 'lib/rbgo/actor.rb', line 12 def handler @handler end |
Instance Method Details
#close ⇒ Object
26 27 28 29 30 |
# File 'lib/rbgo/actor.rb', line 26 def close mail_box.close mail_box.clear nil end |
#closed? ⇒ Boolean
32 33 34 |
# File 'lib/rbgo/actor.rb', line 32 def closed? mail_box.closed? end |
#send_msg(msg) ⇒ Object
20 21 22 23 24 |
# File 'lib/rbgo/actor.rb', line 20 def send_msg(msg) mail_box << msg start_msg_loop nil end |