duck.processesยถ
Module for retrieving or saving all processes created by Duck.
Attributes:
set_main_pid: Saves the main application process ID in json file.
Notes:
When opening a file, an exclusive lock is acquired to avoid race conditions.
Process JSON Format:
{
"process-name": {
"id": "xxx",
"other-data": "xxx"
},
"another-process": {
"id": "xxx",
}
}
Module Contentsยถ
Functionsยถ
Clears all processes data in json file. |
|
Deletes the process data in json file. |
|
Returns all processes data saved in json file. |
|
Retrieves the process data from json file. |
|
Saves the process data in json file. |
Dataยถ
APIยถ
- duck.processes.BASE_DIRยถ
โrstrip(โฆ)โ
- duck.processes.FILENAMEยถ
โ.processes.jsonโ
- duck.processes.clear_processes_data()ยถ
Clears all processes data in json file.
- duck.processes.delete_process_data(name: str) dictยถ
Deletes the process data in json file.
- Returns:
The deleted process data
- Return type:
dict
- duck.processes.get_all_processes_data() dictยถ
Returns all processes data saved in json file.
- duck.processes.get_process_data(name) dictยถ
Retrieves the process data from json file.
- duck.processes.set_process_data(name: str, data: dict, clear_existing_data=False) strยถ
Saves the process data in json file.
- Returns:
The json file in which the process data was saved.
- Return type:
str