Skip to content

Commit

Permalink
Make actor_class accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Jun 3, 2014
1 parent 7b3a1bf commit d6430f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/concurrent/actress/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Core
include TypeCheck
include Concurrent::Logging

attr_reader :reference, :name, :path, :executor, :terminated
attr_reader :reference, :name, :path, :executor, :terminated, :actor_class

# @option opts [String] name
# @option opts [Reference, nil] parent of an actor spawning this one
Expand Down Expand Up @@ -43,9 +43,9 @@ def initialize(opts = {}, &block)

@parent_core.add_child reference if @parent_core

@actress_class = actress_class = Child! opts.fetch(:class), Context
args = opts.fetch(:args, [])
initialized = Type! opts[:initialized], IVar, NilClass
@actor_class = actress_class = Child! opts.fetch(:class), Context
args = opts.fetch(:args, [])
initialized = Type! opts[:initialized], IVar, NilClass

schedule_execution do
begin
Expand Down
5 changes: 5 additions & 0 deletions lib/concurrent/actress/core_delegations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def executor
core.executor
end

def actor_class
core.actor_class
end

alias_method :ref, :reference
alias_method :actress_class, :actor_class
end
end
end
2 changes: 1 addition & 1 deletion lib/concurrent/actress/reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def message(message, ivar = nil)
end

def to_s
"#<#{self.class} #{path}>"
"#<#{self.class} #{path} (#{actor_class})>"
end

alias_method :inspect, :to_s
Expand Down

0 comments on commit d6430f3

Please sign in to comment.