This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-18
Channels
- # aleph (45)
- # aws (4)
- # beginners (56)
- # boot (2)
- # cider (45)
- # clara (2)
- # cljs-dev (9)
- # cljsrn (31)
- # clojure (71)
- # clojure-dusseldorf (8)
- # clojure-gamedev (1)
- # clojure-italy (22)
- # clojure-nl (1)
- # clojure-russia (46)
- # clojure-sg (1)
- # clojure-spec (5)
- # clojure-uk (40)
- # clojurescript (30)
- # community-development (3)
- # cursive (17)
- # data-science (1)
- # datomic (18)
- # emacs (3)
- # figwheel (1)
- # fulcro (19)
- # hoplon (12)
- # jobs (5)
- # leiningen (42)
- # off-topic (12)
- # om (2)
- # onyx (41)
- # re-frame (19)
- # ring-swagger (1)
- # rum (3)
- # shadow-cljs (4)
- # specter (7)
- # unrepl (2)
- # vim (25)
- # yada (24)
sadly our app is a closed source software as a service, but templates like luminus should be a start
they use mount which I'm not as fond of, but the basic ideas are there and luminus is very useful as a big picture starting point which does a lot of things the right way for a web app
Can anyone recommend a good way to deploy a clojure service on a Windows server? A quick google uncovered procrun and winsw as candidates
https://commons.apache.org/proper/commons-daemon/procrun.html Procrun is a set of applications that allow Windows users to wrap (mostly) Java applications (e.g. Tomcat) as a Windows service.
winsw seems really nice
The manifesto for it says: >As the name implies, this is for Windows only. Unix systems have their own conventions for daemons, so a good behaving Unix daemon should just be using launchd/upstart/SMF/etc, instead of custom service wrapper. But I've been looking for a linux daemon which manages a process lifetime. Something that can catch all application crashes, log it, and restart the application with an appropriate context.
For linux I've used supervisord but there's plenty of options I think. http://supervisord.org/
Http-kit, for its non-blocking IO and data-driven interface
oh, I never knew that aleph also shipped a client, worth checking out!
cljs-ajax. so that I can use the same API in frontend and backend
Does anyone know what might cause Datomic to delete databases?: https://stackoverflow.com/questions/46269961/datomic-deletes-databases
I seriously doubt it does, it's most likely some other issue. Can you post the code somewhere were we can take a look at it?
@U07TDTQNL here is the code: (defn establish-conn [] (try (d/create-database (conf/get :db-uri)) (reset! conn (d/connect (conf/get :db-uri))) (catch Throwable t (log/error "Could not establish db conn." t)))) (defn create-db! [] (establish-conn) @(d/transact @conn (collect-schema))) ;;it's used in global exception handler (defn fix-if-conn-ex [ex] (let [err-msg (.getMessage ex)] (when (any? #(str/includes? err-msg %) [":db.error/transactor-unavailable" ":db.error/connection-released"]) (db/establish-conn))))
I made ksml if you're into kafka streams. Still a bit alpha but more fun than the java interop https://github.com/cddr/ksml
@cddr hey i'm actually looking for kafka clients in clj. i went through these repos : 1. https://github.com/pingles/clj-kafka 2. https://github.com/pyr/kinsky 3. https://github.com/ymilky/franzy but they seem to be outdated. What library do you use ?
I don't really use Kafka without Kafka streams. But ksml is a clojure Kafka client. It lets you define a data flow topology in data and then compiles it down to the underlying java interop.
I just use the kafka java api, polling loop inside a manifold future (thread). Not sure how great that is though.
Yeah you can go a long way with Java interop. Kafka itself is moving very fast so wrappers are always out of date unless the maintainer has lots of time to keep on top of the changes
@binora: add https://github.com/weftio/gregor to your list. it's pretty minimal and upto date (this is an upto date fork: https://github.com/ccann/gregor due to https://github.com/weftio/gregor/issues/17)
@binora: we still use clj-kafka, sometimes with https://github.com/yieldbot/torna on top.
With Conj just around the corner, I'm not surprised...
I guess we'll put that in production next week 🙂 We're on Alpha 20 in production right now and already locked for this week's production release.
It's been pretty good for a while, but when's the last time you were bitten by an alpha/beta @seancorfield ?
I honestly can't remember. I remember we dodged a bullet with 1.5.0 -- we were on the last pre-release before the memory leak was introduced and the timing of 1.5.0 was such that we went straight to 1.5.1 in our next build.
Mind you, we have a lot more Clojure in production now than we did back then.
How can I have a macro read in a file next to the source file? (Perhaps something like ns, but with the current directory of the file or something like &env or &form?)
depends, do you want code that works when run from a jar?
because if yes (and that’s the usual answer) things like “current directory” don’t really work (perhaps you can generalize to “path to the current resource”?)
but you really do have to avoid all concepts of “file” or “directory” to make code that packages and deploys correctly without weird hoop jumping
No, it's just a compile time thing.
clojure compiles any time you like
the clojure compiler runs on startup
The issue is I don't want to give the macro a full path to the file. I want to colocate these files next to the source files.
that is, if you deploy a library, it compiles when the jvm starts (with few and rare exceptions)
it would be easy enough to construct the path to a resource out of the current namespace
since namespaces map to resource paths
Yeah, I suppose I could do that. file also gets me close. Was just wondering if this was standard.
if you do it that way, you can ignore the questions of files and directories - use
to find the thing (it won’t matter if it’s a file, a url, a thing inside a jar - it will just work)
@ghopper the standard thing is to only use File and directory based stuff for things that will not be packaged with your code
io/resource works well and abstracts packaging / deployment nicely
Ok, thanks
@alexmiller guards https://github.com/clojure/core.match/wiki/Overview http://shybovycha.github.io/2016/12/21/clojure-guards.html https://github.com/killme2008/defun <- this one uses core.match
you’ve got all those libs ^^ - use those!
I think @dnolen would be happy to have some help with core.match as he has many things on his plate
I don’t think there is anything preventing you from using it now
I will try, but I'm still new in clojure, thanks @alexmiller for the news
I can't speak for @dnolen but core.match is really not alpha at all -- the alpha modifier for the 0.3.0 release might refer to some experimental feature in that specific version but the basic engine is very stable and usable in production
thanks @bronsa, that is really helpful, guards helps a lot in functional development
meh, I wouldn't say they do that much in clojure, we don't do extensive pattern matching like haskell do for example. When people use core.match it's usually for some internal bits, not as a way of doing their general library development (exceptions apply)
@rcustodio That clojure-guards
post just looks like a complicated solution instead of using the built-in cond
expression...
So I'm attempting to build a system to colocate css files with source code. I'm using boot-reload to reload my clojure files. Is there a way to make boot-reload reload clojure files that depend on css files (using http://clojure.java.io/resource)?
Good call :thumbsup: