Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using rpyc as build in proxy in app to dispatch message to remote clinet #541

Open
catchthemonster opened this issue Aug 8, 2023 · 0 comments

Comments

@catchthemonster
Copy link

Hi sorry to intrude,

Hi, great framework, documentation is a bit lacking, but examples even more.
Could anyone just tell me if this is doable?
Have a big framework that has a job scheduler and mp forked threaded rpyc service.
I am forced due to a scheduler and job that is scheduled to push messages to rpc server and exposed class, similar to:

class MyService(rpyc.Service):
class exposed_MyClass(object):
def init(self, a, b):
self.a = a
self.b = b
def exposed_foo(self):
return self.a + self.b

so the internal client in the framework can push messages on the server. However, the remote client is a new session, and even with the callback function message on the service is lost and I am unable to retrieve the job to run.
I tried this on forked service, with threading and the only way that this will work is to use some sort of disk serialization of messages and use the async pattern that the author has as an example of the async file monitor or Events model ...
I am not sure if the state of service implementation object and attributes can be preserved with multiple clients local and remote to the service itself...
Possibly if someone has an example that can show me possibilities I would greatly appreciate it ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant