libmuscle.manager.instance_registry module¶
- class libmuscle.manager.instance_registry.InstanceRegistry[source]¶
Bases:
object
Keeps track of running instances.
The InstanceRegistry is a simple in-memory database that stores information about running instances of simulation components.
Construct an empty InstanceRegistry
- add(name: ymmsl.identity.Reference, locations: List[str], ports: List[ymmsl.component.Port]) None [source]¶
Add an instance to the registry.
- Parameters
name – Name of the instance.
locations – Network locations where it can be reached.
ports – List of ports of this instance.
- Raises
ValueError – If an instance with this name has already been registered.
- get_locations(name: ymmsl.identity.Reference) List[str] [source]¶
Retrieves the locations of a registered instance.
- Parameters
name – The name of the instance to get the location of.
- Raises
KeyError – If no instance with this name was registered.
- get_ports(name: ymmsl.identity.Reference) List[ymmsl.component.Port] [source]¶
Retrieves the ports of a registered instance.
- Parameters
name – The name of the instance whose ports to retrieve.
- Raises
KeyError – If no instance with this name was registered.