Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
Session.close()
Close this session and free all associated resources. The session cannot be used after calling this method. Closing a session frees its port so it can be reused by another session or another process. This method is called by the__del__() method so garbage collected sessions will automatically be closed.
Python synchronously garbage collects objects as soon as their last (hard) reference is lost.
In a notebook, it is thus possible to run the following cell multiple times without encountering a “port already in use” error:
In a notebook, evaluating/printing an object creates long lasting references to it preventing the object from being garbage collected.
The pattern shown above will thus only work if the session object was not used as the last expression of a cell.
- Return type: None