Jarvis and Conga
Jarvis
uses Conga, Dyalog's TCP/IP utility library, for communications. In general most of Jarvis
' default Conga-related settings can be left unchanged. The most likely setting you will want to change is the port number.
Jarvis
requires Conga version 3.0 or later. Conga consists of two elements:
- Two shared library files whose names begin with "conga" and are found in the Dyalog installation folder. The names of the files varies based on the platform they are running on and the specific version of Conga; for instance
conga34_64.dll
andconga34ssl64.dll
are the shared library files for Conga version 3.4 for the 64-bit version of Dyalog for Windows. - An APL-based API to communicate with the shared libraries. There are two versions of the API both of which are available in the
conga
workspace.- A namespace named
Conga
which was introduced with Conga version 3.0 and implements behavior that makes it easier to run multiple Conga-based utilities in the same workspace.Conga
is the recommended API version to use. - A namespace named
DRC
which is retained for backward-compatibility with applications which use earlier versions of Conga.DRC
should only be used in an application where backward compatibility is necessary.
- A namespace named
The Conga API looks for a matching version of the shared libraries; as such the version of the API and the shared libraries must be the same. For more information on Conga please refer to the Conga User Guide.
Default Behavior
When first run, Jarvis
will attempt to find or copy the Conga API and then initialize it. Jarvis
will attempt to use the Conga
version of the API in preference to the DRC
version. In general, all of this is transparent to the user.
- Look in the current workspace for the Conga API:
- First look in the namespace where
Jarvis
resides for a namespace named eitherConga
orDRC
, in that order. - Failing that, look in the root namespace
#
for a namespace named eitherConga
orDRC
, in that order.
- First look in the namespace where
- If neither version of the API is found in the current workspace,
Jarvis
will attempt to copy the API (firstConga
thenDRC
) from theconga
workspace. The API is copied into theJarvis
class which means there will be no additional footprint in workspace.Jarvis
will attempt to copy the API as follows:- If the
DYALOG
environment variable exists, use its folder. Otherwise use the folder from the command line used to start Dyalog. - If that fails, then attempt to copy from the "current" folder as determined by
⊃1 ⎕NPARTS ''
- If the
- If the API was found or successfully copied,
Jarvis
will initialize Conga as follows:- If the
Conga
version of the API is used,Jarvis
will initialize it with a root name of'Jarvis'
. - If the
DRC
version of the API is used,Jarvis
will simply initialize it. AsDRC
does not support multiple roots, care should be taken if other Conga-using utilities also reside in the workspace.
- If the
- If the API was successfully initialized, a reference to the API root can be found in the shared
LDRC
field.
Overriding Default Locations
There are two methods to tell Jarvis
's default behavior, both of which involve setting a shared public field in the Jarvis
class.
- If you have the
Conga
namespace in your workspace in other than default locations theJarvis
will search,Jarvis.CongaRef
can be used to specify its location.CongaRef
can be an actual reference to the namespace or a character array representing the location. For instance:
Jarvis.CongaRef←#.Utils.Conga
or
Jarvis.CongaRef←'#.Utils.Conga'
This can be useful when integratingJarvis
into an application that also uses Conga. Jarvis.CongaPath
can be used to specify the path to the shared library files and optionally the conga workspace. This can be useful when bundlingJarvis
in a distributed application. For instance:
Jarvis.CongaPath←(⊃1 ⎕NPARTS ''),'/conga/'
would tellJarvis
to find the shared libraries in the/conga/
subfolder of the current folder.
Using Other Versions of Conga
If you need to use a version of Conga other than the one in the Dyalog installation folder, there are two ways to accomplish this:
- Put the shared libraries and the
conga
workspace in a folder and setJarvis.CongaPath
to point to that folder. - Put the
Conga
namespace in your workspace (pointingJarvis.CongaRef
to it if necessary) and the shared libraries in a folder setJarvis.CongaPath
to point to that folder.
Multiple Conga-using Components
Conga is used by several Dyalog utilities and packages including Jarvis, HttpCommand, isolate, EWC, and DFS (Dyalog File Server). You might also use it in your application. When you have multiple Conga-using components in your application it is recommended to have a single instance of the Conga
namespace which loads the Conga shared libraries once. Each component should then create their own Conga root.