Skip to content

Commit

Permalink
Support future calls to self
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Sep 3, 2012
1 parent 1e4c6d9 commit 768594f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/celluloid.rb
Expand Up @@ -381,8 +381,12 @@ def async(meth = nil, *args, &block)
end

# Handle calls to future within an actor itself
def future(meth, *args, &block)
Actor.future Thread.current[:actor].mailbox, meth, *args, &block
def future(meth = nil, *args, &block)
if meth
Actor.future Thread.current[:actor].mailbox, meth, *args, &block
else
Thread.current[:actor].proxy.future
end
end
end

Expand Down

0 comments on commit 768594f

Please sign in to comment.