Fork me on GitHub
#clojure-uk
<
2018-09-27
>
seancorfield06:09:07

yo! and g'nite 🙂

👋 8
🛏️ 16
maleghast07:09:55

Morning All :-)

alexlynham07:09:46

@maleghast why do you ask btw?

alexlynham08:09:06

also whoever recommended joker

alexlynham08:09:37

my dumb typos are rapidly becoming a thing of the past

practicalli-johnny08:09:52

I may have mention Joker recently as I was helping someone get it working. Apart from not understanding some macros (a common challenge for tooling I believe) then am really enjoying joker in Spacemacs. Joker encourages me to write better code too :)

agile_geek08:09:04

Bore da pawb welsh_flag

alexlynham08:09:51

well in that case thanks @jr0cket I owe you one 🙂

alexlynham08:09:06

took a bit of hacking to shoehorn it into my emacs config

alexlynham08:09:08

but worth it

practicalli-johnny08:09:14

Well we really should thank all the authors of Joker and Eastwood (and anyone else that shares there code with the community of course). I am certainly indebted to everyone who contributes to Spacemacs and anything in the Clojure/ClojureScript world

jasonbell08:09:14

Morning friends and @otfrom ! 😉

😂 24
maleghast09:09:11

Heya @jasonbell - how’s life?

guy09:09:47

Morning Friends 😄

Rachel Westmacott09:09:50

does anyone here have much experience with hybrid Clojure/Java projects?

mccraigmccraig09:09:28

i did some work on one a long time ago in a galaxy far far away @peterwestmacott - all the java stuff was in its own lein project with tests driven from clj - https://github.com/mccraigmccraig/cascading-cassandra/blob/mccraigmccraig/src/test/com/ifesdjeen/cascading/cassandra/core_test.clj

👀 4
mccraigmccraig09:09:04

cascalog seemed like a good idea at the time

jasonbell10:09:09

@maleghast Yes I'm fine thank you. I trust you are keeping well too.

maleghast10:09:37

@jasonbell - Glad to hear it; I am well, thanks for asking 🙂

thomas12:09:15

@peterwestmacott my mqtt broker is a mix of Java and Clojure in one project. heavily based on http-kit so have a look at that as well

Rachel Westmacott12:09:16

@thomas are you managing that with maven?

thomas12:09:00

no, a single leiningen project that has Java and Clojure code in it.

👍 8
maleghast16:09:28

Anyone up for a quick Integrant question..? I want to define two instances of the same component, each with different config, in my system definition, but the convention seems to be that I need to create a key that is analogous to the namespace of my component, so I can only create one instance of it. Anyone done this?

maleghast16:09:43

Example config:

:ig/system
 {:fv/httpd #merge [#ref [:fv/httpd]
                    {:fv/db-fv #ig/ref :fv/db
                     :fv/event-bus #ig/ref :fv/event-bus
                     :fv/executor #ig/ref :fv/executor}]

  :fv/db {:datasource #ref [:datasource-fv]}

  ;; Restartable executor - used to control threading in manifold
  :fv/executor nil

  ;; An manifold bus to propagate events through the system
  :fv/event-bus nil

  ;; Selmer for HTML templating
  :fv/selmer nil}}

maleghast16:09:51

I'd like to be able to define two database pools, the key :fv/db refers to a component with the namespace fv.db, and it seems to be the case (though I could have misunderstood) that the top-level keys in the Integrant system map (:ig/system) are convention-mapped to namespaces

maleghast16:09:00

Obviously I could copy the component and use another namespace, but that seems crazy to me - I have a nice config-driven component that creates a HikariCP database connection pool and I want to be able to have two pools, one for each database I want to be able to reach in my app. Surely I should be able to define that my system should be created by re-using the database-pool component with two different sets of config than have two actual__ components where the only difference is the namespace, right?

maleghast18:09:57

(Can’t believe that I fell foul of RTFM)

mccraigmccraig18:09:42

fresh pair of eyes &c

mccraigmccraig19:09:08

i don't use integrant, but i would have found it weird if it didn't support that use-case

dominicm19:09:55

You can also use derive. The first use I've seen for the hierarchy system really. I've been trying to think about how I can use it too.

rickmoynihan12:09:11

hierarchies are great… I’ve used them a few times… including the prefer-method extensions. They’re a very much underused feature of clojure imho.