Class Dramatis::Actor::Interface
In: lib/dramatis/actor/interface.rb
Parent: Object

This object should only be accessed from the actor it represents.

Methods

Public Instance methods

Enables the actor to run tasks that match pattern_args. Note that subsequent gate calls may override this behavior.

[Source]

    # File lib/dramatis/actor/interface.rb, line 47
47:   def accept *args
48:     @actor.gate.accept( :object, *args )
49:   end

Causes tasks matching pattern_args to always be accepted if value is true or reject if value is false. always takes precendence over refuse/accept so a task that matches both a refuse pattern and an always( …, true ) pattern will be allowed. always also overrides the implict gating in rpc method calls.

[Source]

    # File lib/dramatis/actor/interface.rb, line 71
71:   def always args, value
72:     @actor.gate.always( ( [ :object ] + Array( args ) ), value )
73:   end

Reverts the behavior of the actor to tasks matching pattern_args to the default. It un-does the affect of a call to refuse or accept with the same arguments.

[Source]

    # File lib/dramatis/actor/interface.rb, line 58
58:   def default *args
59:     @actor.gate.default( [ :object ] + args )
60:   end

Enables call threading for actor method calls made by this actor. When call threading is enabled, method gating is modified such that recursive and co-recursive calls are allowed. Normally blocking calls made by an actor on itself, e.g.,

  actor.name.some_method

would cause a deadlock. When call threading is enabled, recursion, both self-recursion and co-recursion (actor A does an rpc on actor B which does an rpc on actor A), is allowed.

[Source]

    # File lib/dramatis/actor/interface.rb, line 86
86:   def enable_call_threading
87:     @actor.enable_call_threading
88:     nil
89:   end

Returns the actor name for the object.

[Source]

    # File lib/dramatis/actor/interface.rb, line 96
96:   def name
97:     @actor.name
98:   end

Blocks the actor from running any tasks that match pattern_args. Note that subsequent gate calls may override this behavior.

[Source]

    # File lib/dramatis/actor/interface.rb, line 37
37:   def refuse *args
38:     @actor.gate.refuse( :object, *args )
39:   end

Yields the actor to allow other tasks to be executed. Currently, messages are handled FIFO so the yield will return when all the messages received up to the point of the yield are executed. This could be modified if non-FIFO queue processing is added

[Source]

     # File lib/dramatis/actor/interface.rb, line 109
109:   def yield
110:     @actor.actor_send [ :yield ], :continuation => :rpc,
111:                                   :nonblocking => true
112:     nil
113:   end

[Validate]