Closed jamesbraza closed 1 year ago
_pyroClaimOwnership
is a method on a proxy, not on a Pyro server object.
Look at various examples that use it, but mainly the "threadproxysharing" example.
Hi @irmen thank you for the response! Just a brief follow up question, and fyi I am coming from this issue where I am trying to interact with an OpcDaClient
(Pyro5.api.expose
) on multiple threads.
Is there some way to hand ownership of a Pyro server object to another thread? Thank you in advance for your help if you can provide any further guidance.
@jamesbraza There is no concept of exclusive server object ownership in Pyro5 natively. Server object instance(s) - or rather, preferably, classes - are made available to be called concurrently by whatever client can create a proper proxy to call it. If you want to somehow limit the concurrency on objects, you have to control it using the behavior
decorator on the server object, and/or roll your own client/server "pair" protocol somehow perhaps.
I've talked about this a bit more in replies to other past issues for instance here - see there for some relevant doc links
and be sure to study the "instancemode" and "usersession" examples, amongst others
Let's say I have a minimal API:
I am trying to use
_pyroClaimOwnership()
onfoo
above, but am getting anAttributeError
:How do exposed API's call
_pyroClaimOwnership()
?