Cmdline-option to keep newlisp instance running

Q&A's, tips, howto's
Post Reply
HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Cmdline-option to keep newlisp instance running

Post by HPW »

Hello,

I could thing about a cmdline option for newlisp to keep it running.
This means I can call the newlisp.exe simply a second time and instead of starting a second instance it passes the cmdline-args to the running instance and call there a predefined function with it.

Sample:

Code: Select all

newlisp.exe -k funcname
-k stands for keep running and listen to the cmdline.
The funcname is called on the second call of the exe and gets the cmdline-aruments of the second call passed.

Second or further call:

Code: Select all

newlisp.exe param1 param2 ....
would call:

Code: Select all

(funcname param1 param2 ....)
The function is either loaded per cmdline on the first call or is placed in init.lsp
The running instance can be terminated as always by executing the (exit) funktion.

What do you think of such native support?
Of cource it would be possible to build such option with a custom exe with newlisp.dll
Benefit would be to hold huge data in memory with one loading and do processing on it with small individual calls. Kind of newlisp-state-mashine.

Or the other way round.
Start a normal instance and use this for the second call:

Code: Select all

newlisp.exe -r funcname param1 param2 
-r stands for use running instance and call function with params.

Regards
Hans-Peter

ralph.ronnquist
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Cmdline-option to keep newlisp instance running

Post by ralph.ronnquist »

Isn't that kind of what -d offers?
Though you'd connect to it with, say, telnet or netcat (or whatever it's called on Windows).

HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: Cmdline-option to keep newlisp instance running

Post by HPW »

Hello,

Similar but not the same. Not so simple as a series of cmdline-call.

Regards
Hans-Peter

HPW
Posts: 1377
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: Cmdline-option to keep newlisp instance running

Post by HPW »

Hello,

For the interested WIN user:

I made a delphi-wrapper which allow to run only one instance and hold the newlisp.dll running.

Image

The log entrys comes from subsequent calls to different batch files.

For the intereseted here the zip with the exe and the test batch files:

http://hpwsoft.de/anmeldung/html1/newLISP/nlCmd.zip
(Zip contains the ANSI-DLL 10.703)

Regards
Hans-Peter

Post Reply