user3516540
user3516540

Reputation: 73

passing class methods in rpyc python

I have seen passing a functions using teleport_function, is there any way to pass class methods ?? or can I execute my class object remotely in any other way

I can alternative work around by making class a service . But that does not serve completely my requirement in my project.

Upvotes: 2

Views: 642

Answers (1)

user2563547
user2563547

Reputation: 107

import rpyc
from rpyc.utils.classic import teleport_function

def a(test):
    print test

if __name__ = '__main__':
    proxy = rpyc.classic.connect('remte.com')
    launch_command_remote = teleport_function(proxy, a)
    launch_command_remote("Voila") # Executed remotly

Upvotes: -1

Related Questions