I'm trying to make a class object usable for multiple processes. Unfortunarely this seems to be more of an issue than I anticipated.
I have the following class object:
class BusObject: inputs: IOObject outputs: IOObject def __init__(self): self.inputs = IOObject() self.outputs = IOObject() with the associated object IOObject
class IOObject: idx: List[int] # signal index tag: List[str] # signal tag def __init__(self): self.idx = [] self.tag = [] This combination worked fine. But now I run into the requirement that I have to make the BusObject available to multiple processes.
Therefore I created a custom multiprocessing.manager
class CustomManager(BaseManager): pass def main(): manager = CustomManager() # Registration of custom classes to manager manager.register('BusObject', BusObject) # manager.register('IOObject', IOObject) manager.start() busObject = manager.BusObject() Works - almost ...
The problem is that the associated objects don't seem to be registered as well.
I tried to register them, too, but even if I do I run into the error
AttributeError 'AutoProxy[BusObject]' object has no attribute 'inputs' Any ideas?
IOObjectisn't a subclass ofBusObject.