Manager
A manager for orchestrating tasks and resources.
Usage
Manager()Parameters
name: str-
The name of the manager instance.
Examples
>>> m = Manager("prod")
>>> m.status()
'idle'Methods
| Name | Description |
|---|---|
| __init__() | Initialize the manager. |
| configure() | Configure the manager with the given options. |
| report() | Generate a status report for the manager. |
| restart() | Restart the manager by stopping and starting it. |
| start() | Start the manager. |
| status() | Return the current status of the manager. |
| stop() | Stop the manager. |
__init__()
Initialize the manager.
Usage
__init__(name)Parameters
name: str-
The name of the manager.
configure()
Configure the manager with the given options.
Usage
configure(options)Parameters
options: dict-
A dictionary of configuration options.
Returns
None
Examples
>>> m = Manager("test")
>>> m.configure({"timeout": 30})report()
Generate a status report for the manager.
Usage
report()Returns
dict-
A dictionary containing the manager’s status report.
Examples
>>> m = Manager("test")
>>> m.report()
{'name': 'test', 'running': False}restart()
Restart the manager by stopping and starting it.
Usage
restart()Returns
None
start()
Start the manager.
Usage
start()Returns
None
Examples
>>> m = Manager("test")
>>> m.start()
>>> m.status()
'running'status()
Return the current status of the manager.
Usage
status()Returns
str-
Either ‘running’ or ‘idle’.
stop()
Stop the manager.
Usage
stop()Returns
None
Examples
>>> m = Manager("test")
>>> m.start()
>>> m.stop()
>>> m.status()
'idle'