Module: Thespian

Defined in:
lib/thespian.rb,
lib/thespian/dsl.rb,
lib/thespian/actor.rb,
lib/thespian/errors.rb,
lib/thespian/example.rb,
lib/thespian/version.rb,
lib/thespian/strategies/fiber.rb,
lib/thespian/strategies/thread.rb,
lib/thespian/strategies/process.rb,
lib/thespian/strategies/interface.rb

Overview

Include this module into classes to give them acting abilities.

class ArnoldSchwarzenegger
  include Thespian

  actor.receive do |message|
    handle_message(message)
  end

  def handle_message(message)
    puts message
  end
end

arnold = ArnoldSchwarzenegger.new
arnold.actor.start
arnold.actor << "I'm a cop, you idiot!"
arnold.actor.stop

For a general overview of this gem, see the README.rdoc.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods, Strategy Classes: Actor, DeadActorError, Dsl, Example, Stop

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object

:nodoc:



28
29
30
31
# File 'lib/thespian.rb', line 28

def self.included(mod) #:nodoc:
  mod.send(:extend,  ClassMethods)
  mod.send(:include, InstanceMethods)
end