Sha256: aac37f1d4d67c9967bab61a9dd39f5c8c1e7f870e5565a7caee3a3376331d3e0
Contents?: true
Size: 898 Bytes
Versions: 6
Compression:
Stored size: 898 Bytes
Contents
class PipeRpc::Request; end module PipeRpc class Hub::Request < Request def initialize(hub, body) @hub = hub super body end CALL_FILE, CALL_LINENO = __FILE__, __LINE__+4 def handle evaluate_result do # the block is passed for asynchronous evaluation @hub.servers[server].__send__(method, *arguments, &evaluate_result_proc) end end def evaluate_result(result = nil, &block) result = Result.new(self, block_given? ? yield : result) rescue Exception => e result = ErrorResult.new(self, e) ensure asynchronous = result.value == evaluate_result_proc @hub.socket.write(result.to_response) unless asynchronous return result.value end def evaluate_result_proc @evaluate_result_proc ||= proc do |result = nil, &block| evaluate_result(result, &block) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems