System¶
The System class provides access to the running Nutshell virtual machine
information, environment properties, and lifecycle management.
Synopsis¶
Static Methods¶
System.exit([code])System.fps()System.script_path()System.spawn_vm(scriptPath)System.stop_vm(id)System.ups()System.vm_count()
Static Members¶
System.archSystem.idSystem.osSystem.versionSystem.version_commitSystem.version_is_wipSystem.version_majorSystem.version_minorSystem.version_patchSystem.version_prerelease
Static Methods¶
System.exit([code])¶
Requests application shutdown with an optional exit code.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
code |
int |
No | The code to use as application exit code. Default: 0. |
System.fps()¶
Get the rendered frames per seconds for the current virtual machine.
- Returns:
float: Current rendered frames per seconds for the current virtual machine.
System.script_path()¶
Get the current script path.
- Returns:
string: The script path of the running script.
System.spawn_vm(scriptPath)¶
Spawns a new virtual machine and let it run the given script.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
scriptPath |
string |
Yes | The script to use for the newly spawned virtual machine. |
- Returns:
string: The newly spawned VM identifier.
System.stop_vm(id)¶
Stops a virtual machine by its identifier.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | The identifier of the virtual machine to stop. |
System.ups()¶
Get the updates per seconds for the current virtual machine.
- Returns:
float: Current updates per seconds for the current virtual machine.
System.vm_count()¶
Get the number of currently active virtual machines.
- Returns:
int: The current count of active virtual machines.
Static Members¶
System.arch¶
- Type:
string
The current running operating system architecture.
System.id¶
- Type:
string
The current running virtual machine identifier.
System.os¶
- Type:
string
The current running operating system flavor.
System.version¶
- Type:
string
The current semantic version of Nutshell.
System.version_commit¶
- Type:
string
The commit part of Nutshell's semantic version.
System.version_is_wip¶
- Type:
bool
true if this is a work in progress Nutshell build, false otherwise.
System.version_major¶
- Type:
int
The major part of Nutshell's semantic version.
System.version_minor¶
- Type:
int
The minor part of Nutshell's semantic version.
System.version_patch¶
- Type:
int
The patch part of Nutshell's semantic version.
System.version_prerelease¶
- Type:
string
The prerelease part of Nutshell's semantic version.