Compare commits
No commits in common. "5e61e89ac154304acb6f2d7632c88cc010888d53" and "1e627b833e3a96eb91f8616d73488b9fb689f36e" have entirely different histories.
5e61e89ac1
...
1e627b833e
@ -92,27 +92,6 @@ class LRPCClient
|
|||||||
@conn.send(data.buffer)
|
@conn.send(data.buffer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# getClient returns an object containing functions
|
|
||||||
# corresponding to registered functions on the given
|
|
||||||
# receiver. It uses the lrpc.Introspect() endpoint
|
|
||||||
# to achieve this.
|
|
||||||
def getObject(rcvr)
|
|
||||||
return Promise.new do |resolve|
|
|
||||||
# Introspect methods on given receiver
|
|
||||||
self.callMethod("lrpc", "Introspect", rcvr).then do |methodDesc|
|
|
||||||
# Create output object
|
|
||||||
out = {}
|
|
||||||
# For each method in description array
|
|
||||||
methodDesc.each do |method|
|
|
||||||
# Create and assign new function to call current method
|
|
||||||
out[method.Name] = proc { |arg| return self.callMethod(rcvr, method.Name, arg) }
|
|
||||||
end
|
|
||||||
# Resolve promise with output promise
|
|
||||||
resolve(out)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# LRPCChannel represents a channel used for lrpc.
|
# LRPCChannel represents a channel used for lrpc.
|
||||||
@ -166,7 +145,6 @@ class LRPCChannel
|
|||||||
# close closes the channel. This should not be called by the
|
# close closes the channel. This should not be called by the
|
||||||
# consumer of the channel. Use done() instead.
|
# consumer of the channel. Use done() instead.
|
||||||
def close()
|
def close()
|
||||||
return if @closed
|
|
||||||
fn = @onClose
|
fn = @onClose
|
||||||
fn()
|
fn()
|
||||||
@closed = true
|
@closed = true
|
||||||
|
Reference in New Issue
Block a user