Skip to content

Commit

Permalink
Merge e05dd48 into 11abb6e
Browse files Browse the repository at this point in the history
  • Loading branch information
halorgium committed Apr 7, 2013
2 parents 11abb6e + e05dd48 commit d8e95fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/celluloid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def exclusive(*methods)

# Mark methods as running blocks on the receiver
def execute_block_on_receiver(*methods)
@receiver_block_executions ||= Set.new
@receiver_block_executions ||= Set.new([:after, :every, :receive])
@receiver_block_executions.merge methods.map(&:to_sym)
end

Expand All @@ -233,7 +233,7 @@ def actor_options
:task_class => task_class,
:exit_handler => exit_handler,
:exclusive_methods => defined?(@exclusive_methods) ? @exclusive_methods : nil,
:receiver_block_executions => defined?(@receiver_block_executions) ? @receiver_block_executions : [:initialize, :after, :every, :receive]
:receiver_block_executions => defined?(@receiver_block_executions) ? @receiver_block_executions : nil
}
end

Expand Down
9 changes: 7 additions & 2 deletions lib/celluloid/actor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,13 @@ def handle_message(message)
handle_system_event message
when Call
task(:call, message.method) {
if @receiver_block_executions && (message.method && @receiver_block_executions.include?(message.method.to_sym))
message.execute_block_on_receiver
if @receiver_block_executions && meth = message.method
if meth == :__send__
meth = message.arguments.first
end
if @receiver_block_executions.include?(meth.to_sym)
message.execute_block_on_receiver
end
end
message.dispatch(@subject)
}
Expand Down

0 comments on commit d8e95fd

Please sign in to comment.