Hello,
Suppose I have the following server:
import rpyc
class MyService(rpyc.Service):
def exposed_func(self):
return {"a": 10, "b": 20}
service = MyService()
server = rpyc.utils.server.ThreadedServer(service, port=20000)
server.start()
When a client queries func(), it receives a netref to the dictionary that is supposed to exist at the server side.
However, at the server side, the dict value has already gone out of scope after exposed_func() returns, and is thus eligible for being garbage collected.
How does the server-side ensure that the value returned by exposed_func() still exists for the netref to be valid? Who takes ownership (and manages the lifetime of) the dict returned by the exposed_func()?
Hello,
Suppose I have the following server:
When a client queries
func(), it receives a netref to the dictionary that is supposed to exist at the server side.However, at the server side, the dict value has already gone out of scope after
exposed_func()returns, and is thus eligible for being garbage collected.How does the server-side ensure that the value returned by
exposed_func()still exists for thenetrefto be valid? Who takes ownership (and manages the lifetime of) the dict returned by theexposed_func()?