joker

gleisonsilva 2020-07-04T16:04:27.098Z

Some tip to avoid running a joker process (without relying in ps if using Linux) to check if an instance of Joker is running? I can't let the user run this script in parallel...

jcburley 2020-07-05T03:39:23.100100Z

As Joker can be running a script, REPL, or a lint checker, it’s probably best to not gate access to a resource (manipulated by a particular Joker script) on whether any other Joker instance is running. E.g. you wouldn’t want to prevent a script running just because its interpreter (whether Joker, bash, or python) happens to be running somewhere else on the system.

gleisonsilva 2020-07-04T16:05:14.098700Z

I'm search for some kind of simple 'locking' or 'exclusive access' to some resource to avoid collision...

jcburley 2020-07-05T03:37:18.099800Z

IMO this is best done by wrapping, with a locking scheme, access to the resource itself, rather than to the script that manipulates it, as tempting as that might be for a quick one-off need.

👍 1
gleisonsilva 2020-07-04T16:06:12.099400Z

Or even some way to get the PID of the process that the script is running in

jcburley 2020-07-05T03:34:59.099500Z

This works in my gostd fork (though that’s definitely not “stable” at this time):

user=> (go.std.os/Getpid)
9220
user=> (go.std.os/Getppid)
564
user=>
Functions like this could probably be easily ported to joker.os in the official version.