A Session is a running instance of CET. Only one Session may be opened at a time - even if the Enable multiple drawings setting is turned on, there is still only one Session containing multiple Worlds.
Characteristics
- Provides interfaces for creating, selecting, and removing Worlds.
- Provides interfaces to access the main app Window, Worlds, Spaces, and Views.
- Views are validated in Session's flush method (called from CET's main message loop).
- Handles background saves.
Flush and Flush Hooks
flush is a method in Session that is executed a few times every second.
In core, it's used to catch and log potential failure of crucial processes, detect processes that take too long, trigger background saves, etc.
We have hooks that added into a hook collection to trigger processes when flush in cm/core/coreGlobals.cm :
/*************************************************************************** * Flush. ***************************************************************************/ /** * Before session flush hook. */ public (function()) {} beforeSessionFlushHooks() : keep; /** * After session flush hook. */ public (function()) {} afterSessionFlushHooks() : keep;
Processes registered in this will take place a few times every second. So please take caution to not put in heavy computational processes as it CAN and WILL slow down the whole CET software.
Comments
0 comments
Please sign in to leave a comment.