DaemonMode.jl icon indicating copy to clipboard operation
DaemonMode.jl copied to clipboard

Exit code from a script

Open feanor12 opened this issue 4 years ago • 6 comments

Is it possible to return the correct exit code when using runfile()?

Maybe overwriting exit with a return would enable to exit correctly without killing the server.

exit(x) = return x
exit(4)

feanor12 avatar Jan 30 '21 15:01 feanor12

Thank you for the idea. However, how do you think it should be consulted the exit code? As the return of runfile() function?

dmolina avatar Jan 30 '21 19:01 dmolina

Yes, I think a return value or struct containing the exit code would work.

feanor12 avatar Jan 30 '21 20:01 feanor12

Now runargs() returns error code if any Exception is run. However, I still have not yet fixed the exit() problem.

dmolina avatar Feb 06 '21 17:02 dmolina

Would it be useful to be able to pass binary objects between the server and the client? I was thinking maybe the exception(or any other return value) can be passed. This would require some updates in the server-client protocol though. Maybe MsgPack.jl or Serialization would work?

feanor12 avatar Feb 07 '21 11:02 feanor12

Now the last version, v0.1.7 allow to run the exit function in the client without any problem. Even more, the result of the exit function is returned by the client (well, 0 or 1). Finally I have created a local exit function that returns a specific Exception that is detected by the Daemon for not considering it as a real Exception.

Sorry for the delay, but I was working a little allowing threads, that I considered had higher priority.

dmolina avatar Mar 24 '21 12:03 dmolina

About the passing of binary objects, I expect to add it in a future remote version (but maybe it could be done in a new package, DaemonRemoteMode.jl?).

dmolina avatar Mar 24 '21 12:03 dmolina