Finalize#
-
void YR::Finalize()#
Finalizes the Yuanrong system.
This function is responsible for releasing resources such as function instances and data objects that have been created during the execution of the program. It ensures that no resources are leaked, which could lead to issues in a production environment.
YR::Config conf; conf.mode = YR::Config::Mode::CLUSTER_MODE; YR::Init(conf); YR::Finalize();
Note
In a cluster deployment scenario, if worker processes exit and restart, it might lead to process residuals. In such cases, it is recommended to redeploy the cluster. Deployment scenarios like Donau or SGE can rely on the resource scheduling platform’s capability to recycle processes.
This function should be called after the system has been initialized with the appropriate Init function. Calling Finalize before Init will result in an exception.
- Throws:
Exception – If Finalize is called before the system is initialized, the exception “Please init YR first” will be thrown.