Stops the run and releases all the resources.
Stops the run and releases all the resources.
This must be called to ensure the run's resources are released.
Whether or not this makes the run fail or not is up to the implementation. However, in the following cases, calling close may not fail the run:
Idempotent, async, nothrow.
A Future that completes if the run completes.
A Future that completes if the run completes.
The future is failed if the run fails.
Note that a JSRun is not required to ever terminate on it's own. That means even if all code is executed and the event loop is empty, the run may continue to run. As a consequence, it is *not* correct to rely on termination of a JSRun without any external means of stopping it (i.e. calling close).
A launched instance of a JSEnv.
This is the interface to actually running JS code (whether this is in process or not depens on the JSEnv that created the JSRun).
Any implementation is expected to be fully thread-safe.