0

High level overview: I have a server.py file and a class WorkTask.py that has some function execute in it, both stored on my server. I also have a client.py that runs remotely and connects to the server using pyro. Is there anyway that I can pass the WorkTask class from the server to the client and then run the WorkTask.execute() function on the client side?

Dylan
  • 949
  • 3
  • 13
  • 23
  • Do you want the client's CPU to run the `WorkTask.execute()`, or do you want the server's CPU to run it but just have the client execute it? – Matthew Moisen Dec 01 '15 at 18:39

1 Answers1

1

Only if you have a copy of WorkTask.py on the client already, and are using the pickle serializer.

You could also perhaps look at Pyro4.utils.flame.createModule(). See https://pythonhosted.org/Pyro4/flame.html

It's a big security risk though because using pickle allows for arbitrary code execution if you connect to an untrusted remote party.

Irmen de Jong
  • 2,739
  • 1
  • 14
  • 26