Page 1 of 1

Cmdline-option to keep newlisp instance running

Posted: Sun Dec 02, 2018 8:32 am
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

Re: Cmdline-option to keep newlisp instance running

Posted: Sun Dec 02, 2018 10:23 am
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).

Re: Cmdline-option to keep newlisp instance running

Posted: Sun Dec 02, 2018 12:11 pm
by HPW
Hello,

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

Regards

Re: Cmdline-option to keep newlisp instance running

Posted: Sun Dec 09, 2018 6:06 pm
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