Skip to content

Commit

Permalink
Merge pull request #2 from tagomoris/celluloid_ondemand
Browse files Browse the repository at this point in the history
fix not to require before using Celluloid actually
  • Loading branch information
authorNari committed May 13, 2013
2 parents 0603f28 + f2fcd4f commit 2bf3e9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/msgpack/rpc_over_http/client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'celluloid'
# require 'celluloid'
require 'httpclient'
require 'forwardable'

Expand Down Expand Up @@ -36,6 +36,7 @@ def call(method, *args)
# Calls remote method asynchronously.
# This method is non-blocking and returns Future.
def call_async(method, *args)
require 'celluloid'
return Celluloid::Future.new{ send_request(method, args) }
end

Expand All @@ -46,6 +47,7 @@ def call_async(method, *args)
# The callback method is called with Future when the result is reached.
# `err' is assigned a instance of RemoteError or child if res is nil.
def callback(method, *args, &block)
require 'celluloid'
return Celluloid::Future.new do
begin
block.call(send_request(method, args))
Expand Down Expand Up @@ -76,6 +78,7 @@ def stream(method, *args, &block)
#
# Calls remote method asynchronously with streaming.
def stream_async(method, *args, &block)
require 'celluloid'
return Celluloid::Future.new do
stream(method, *args, &block)
end
Expand Down

0 comments on commit 2bf3e9e

Please sign in to comment.