Created
April 14, 2017 17:52
-
-
Save neektza/46f812d13634ce063c8a2ea4c6cb49c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SyncProxy < AbstractProxy | |
def method_missing(meth, *args, &block) | |
# ... snip | |
call = ::Celluloid::Call::Sync.new(::Celluloid.mailbox, meth, args, block) | |
@mailbox << call | |
call.value | |
end | |
end | |
# Async method interception | |
class AsyncProxy < AbstractProxy | |
def method_missing(meth, *args, &block) | |
# ... snip | |
@mailbox << ::Celluloid::Call::Async.new(meth, args, block) | |
self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment