Instance Methods
Most of Jarvis
' instance methods return a return code, rc
, and a message, msg
.
rc
is 0 to indicate success, a non-zero value indicates some error or warning condition
msg
is a (hopefully) meaningful message describing the success or error
Below, the methods you are more likely to use are presented first.
Start
Description |
Start starts or resumes a Jarvis instance. |
Syntax |
(rc msg)←j.Start |
Examples |
j.Start 2025-09-01 @ 10.14.54.476 - Starting Jarvis 1.20.6 2025-09-01 @ 10.14.54.493 - Conga copied from C:\Program Files\Dyalog\Dyalog APL-64 20.0 Unicode/ws/conga 2025-09-01 @ 10.14.54.494 - Local Conga v3.6 reference is #.Jarvis.[LIB] 2025-09-01 @ 10.14.54.499 - Jarvis starting in "JSON" mode on port 8080 2025-09-01 @ 10.14.54.500 - Serving code in # 2025-09-01 @ 10.14.54.506 - Click http://192.168.223.137:8080 to access web interface 0 Server started |
Stop
Description |
Stop stops a running Jarvis instance. |
Syntax |
(rc msg)←j.Stop |
Examples |
j.Stop 2025-09-01 @ 10.54.24.701 - Stopping server... 0 Server stopped
j.Stop ⍝ try stopping a stopped server ¯1 Server is not running |
Config
Description |
Config returns all of the settings for a Jarvis instance. |
Syntax |
r←j.Config |
r |
is a 2-column matrix of [;1] setting names, [;2] setting values. |
Examples |
j.Config AcceptFrom AllowFormData 0 AllowGETs 0 AppCloseFn AppInitFn AuthenticateFn BufferSize 10000 CORS_Headers * CORS_MaxAge 60 CORS_Methods GET,POST,OPTIONS ORS_Origin * ... and so on and so forth |
Notes |
At present, there are about 60 settings that are displayed. |
EndPoints
Description |
Syntax |
`` |
Examples |
Notes |
Pause
Description |
Pause "pauses" a running Jarvis instance. Pausing causes Jarvis to refuse any new connections. Existing connections will continue to be served. The Start method will "unpause" a paused Jarvis . |
Syntax |
(rc msg)←j.Pause |
Examples |
j.Pause 2025-09-01 @ 10.57.13.275 - Pausing server... 0 Server paused j.Pause ⍝ try pausing a paused server ¯2 Server is already paused j.Start ⍝ restart a paused server 2025-09-01 @ 11.03.31.296 - Starting Jarvis 1.20.6 0 Server resuming operations j.Stop 2025-09-01 @ 10.58.36.630 - Stopping server... 0 Server stopped j.Pause ⍝ try pausing a stopped server ¯1 Server is not running |
Notes |
Running
Description |
Running returns a 1 if Jarvis is running or paused, 0 otherwise. |
Syntax |
r←j.Running |
Thread
Description |
Thread returns the thread number if the server is running or ⍬ if the server is not running. |
Syntax |
thread←j.Thread |
Log
Description |
Log is an overridable method used to log messages. By default if Logging is set to 1 the message passed as the right argument is displayed with a timestamp in the APL session. |
Syntax |
{msg}←{level}Log msg |
msg |
The message to be displayed. This is also returned as the shy result. |
level |
(optional) The message level. This is not used in the default Log method, but is included so that an overriding method can make use of it to distinguish between different types of messages, for instance informational, warning, and error messages. |
Examples |
To use Log from an endpoint, you need to use the reference to the Jarvis server that is supplied in the Request object. One might write something like
req.server.Log 'Endpoint "',(⊃⎕SI),'" called' to log whenever an endpoint is called. |
Notes |
We intend to implement more comprehensive logging in a future release of Jarvis. |
Reset
Description |
Reset "resets" Jarvis by killing all Jarvis -related threads and clearing any session information. Reset does not affect any Jarvis settings. |
Syntax |
(rc msg)←j.Reset |
Examples |
j.Reset 0 Server reset (previously set options are still in effect) |
Notes |
Reset is rarely needed but can be useful during endpoint development. |