This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-04
Channels
- # announcements (9)
- # bangalore-clj (1)
- # beginners (164)
- # calva (7)
- # clj-kondo (12)
- # cljs-dev (5)
- # cljsrn (7)
- # clojure (100)
- # clojure-spec (5)
- # clojure-sweden (2)
- # clojure-uk (4)
- # clojurescript (9)
- # conjure (22)
- # datomic (53)
- # fulcro (62)
- # graalvm (27)
- # helix (10)
- # joker (6)
- # malli (1)
- # mount (4)
- # nrepl (3)
- # off-topic (8)
- # quil (1)
- # releases (1)
- # sci (42)
- # shadow-cljs (1)
- # testing (7)
- # tools-deps (26)
- # vim (24)
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...
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.
I'm search for some kind of simple 'locking' or 'exclusive access' to some resource to avoid collision...
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.
Or even some way to get the PID of the process that the script is running in
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.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.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.
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.