Cmdline-option to keep newlisp instance running

Started by HPW, December 02, 2018, 12:32:04 AM

Previous topic - Next topic

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:


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:
newlisp.exe param1 param2 ....
would call:
(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:
newlisp.exe -r funcname param1 param2

-r stands for use running instance and call function with params.



Regards
Hans-Peter

rrq

#1
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

#2
Hello,



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



Regards
Hans-Peter

HPW

#3
Hello,



For the interested WIN user:



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



http://hpwsoft.de/anmeldung/html1/newLISP/nlCmd.png">



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">http://hpwsoft.de/anmeldung/html1/newLISP/nlCmd.zip

(Zip contains the ANSI-DLL 10.703)



Regards
Hans-Peter