There's a small but growing list of optional re-usable components that provide extra functionality :-
I know others are working on similar designs. I'd be interested to hear what people think and whether this is useful.
Thanks,
Malcolm
PS: Jig can be found here: https://github.com/juxt/jig
... in *Messages*Connecting to nREPL on 127.0.0.1:4555...open-network-stream: make client process failed: connection refused, :name, nrepl, :buffer, *nrepl-connection*, :host, 127.0.0.1, :service, 4555, :nowait, nil... in emacs' minibuffer linemake client process failed: connection refused, :name, nrepl, :buffer, *nrepl-connection*, :host, 127.0.0.1, :service, 4555, :nowait, nil
~/Projects/jig$ lein replnREPL server started on port 33095 on host 127.0.0.1REPL-y 0.2.1Clojure 1.5.1Welcome to Jig!(go) -- start the system(reset) -- reset the system(refresh) -- recover if a reset fails due to a compilation error(menu) -- show this menu againJig user> (go)NullPointerException clojure.core/val (core.clj:1489)Jig user> (pst *e)NullPointerExceptionclojure.core/val (core.clj:1489)loom.graph/build-graph/build--1546 (graph.clj:411)clojure.core.protocols/fn--6037 (protocols.clj:127)clojure.core.protocols/fn--6005/G--6000--6014 (protocols.clj:19)clojure.core.protocols/seq-reduce (protocols.clj:31)clojure.core.protocols/fn--6028 (protocols.clj:48)clojure.core.protocols/fn--5979/G--5974--5992 (protocols.clj:13)clojure.core/reduce (core.clj:6177)loom.graph/build-graph (graph.clj:425)clojure.core/apply (core.clj:619)loom.graph/digraph (graph.clj:437)jig.system/get-digraph (system.clj:87)nil
{:components{:recordo {:jig/component org.recordo.core/Component:jig/project "../recordo/project.clj"}}}
(ns recordo.core(:import (jig Lifecycle)));; A Jig Component(deftype Component [config]Lifecycle(init [_ system] system)(start [_ system] system)(stop [_ system] system))
Looks very interesting, thanks for sharing! BTW, documentation is impressive and quite comprehensive.
On a related note: I've spotted a couple of typos in your README.md so far. Do you accept pull requests for small fixes like these?
Chris
:server {:jig/component jig.web.server/Component ;; how do I pass in my Compojure route handler ?:io.pedestal.service.http/port 8000:io.pedestal.service.http/type :jetty}
:juxtweb/web {:jig/component jig.web.app/Component ;; how do I pass in my routing table of handlers ?:jig/dependencies [:server]:jig/scheme :http:jig/hostname "localhost":jig.web/server :server}
{:jig/components{;; ===>:server {:jig/component jig.web.server/Component:io.pedestal.service.http/port 8000:io.pedestal.service.http/type :jetty}
:jig/dependencies [:server]:jig/scheme :http:jig/hostname "localhost":jig.web/server :server}
;; ===>:stefon-webui-common {:jig/component stefon-webui-common.core/Component:jig/project "../stefon-webui-common/project.clj"}
:stefon-compojure {:jig/component stefon-compojure.core/Component:jig/project "../stefon-compojure/project.clj":jig/dependencies [:server:stefon-webui-common]}:stefon-pedestal {:jig/component stefon-pedestal-service.service/Component:jig/project "../stefon-pedestal-service/project.clj":jig/dependencies [:juxtweb/web:stefon-webui-common]:jig.web/app-name :juxtweb/web}}}
~/Projects/trial/JIG$ ls -laaccounting/ ;; had to `mv juxt-accounting accounting`jig/juxtweb/
java.io.FileNotFoundException: /home/malcolm/Dropbox.private/JUXT/accounts.edn
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/E0BdR_AksiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
$ lein replnREPL server started on port 59398 on host 127.0.0.1
REPL-y 0.2.1Clojure 1.5.1Welcome to Jig!(go) -- start the system(reset) -- reset the system(refresh) -- recover if a reset fails due to a compilation error(menu) -- show this menu againJig user> (go)
INFO jig.system - Starting the systemINFO jig.system - Starting component ':test-ring-handler'INFO jig.system - Starting component ':compojure'INFO jig.system - Starting component ':jetty'INFO org.eclipse.jetty.server.Server - jetty-8.1.9.v20130131INFO o.e.jetty.server.AbstractConnector - Started SelectChann...@0.0.0.0:8091INFO jig.system - Starting component ':console/server'INFO org.eclipse.jetty.server.Server - jetty-8.1.9.v20130131INFO o.e.jetty.server.AbstractConnector - Started SelectChann...@0.0.0.0:8001INFO jig.system - Starting component ':console/web'INFO jig.system - Starting component ':console/readme':readyJig user> INFO i.p.s.http.impl.servlet-interceptor - {:line 362, :in :interceptor-service-fn, :context {:servlet #<FnServlet io.pedestal.service.http.servlet.FnServlet@606acc48>, :servlet-config #<Config org.eclipse.jetty.servlet.ServletHolder$Config@19017f49>, :servlet-response #<Response HTTP/1.1 200>, :servlet-request #<Request (GET /)@1536124838 org.eclipse.jetty.server.Request@5b8f67a6>}}INFO io.pedestal.service.http - {:line 58, :msg "GET /"}INFO i.p.s.http.impl.servlet-interceptor - {:line 362, :in :interceptor-service-fn, :context {:servlet #<FnServlet io.pedestal.service.http.servlet.FnServlet@606acc48>, :servlet-config #<Config org.eclipse.jetty.servlet.ServletHolder$Config@19017f49>, :servlet-response #<Response HTTP/1.1 200>, :servlet-request #<Request (GET /web)@1536124838 org.eclipse.jetty.server.Request@5b8f67a6>}}INFO io.pedestal.service.http - {:line 58, :msg "GET /web"}INFO i.p.s.http.impl.servlet-interceptor - {:line 362, :in :interceptor-service-fn, :context {:servlet #<FnServlet io.pedestal.service.http.servlet.FnServlet@606acc48>, :servlet-config #<Config org.eclipse.jetty.servlet.ServletHolder$Config@19017f49>, :servlet-response #<Response HTTP/1.1 200>, :servlet-request #<Request (GET /readme)@1536124838 org.eclipse.jetty.server.Request@5b8f67a6>}}INFO io.pedestal.service.http - {:line 58, :msg "GET /readme"}
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
Hi Tim,
--
Also, is there a Google Group for Jig? I'm playing around with it, can see the potential, and already have some questions.
(follow up)I just realized that another approach would be to hold the jdbc connection type implementing the JDBCProtocol in system under [:jdbc-component :db] or something, and then call the clojure.java.jdbc/query like functions on that. Anyway, I would be very happy to hear your comments on this!
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/E0BdR_AksiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
I have a follow up question if you don't mind. Suppose I want to define a component that starts a thread and regularly checks a resource. If the resource changes, this has repercussions for other (dependent) components. How would you do that in jig?
--
update: I made mistake at the end of my previous post: I mean "that the db component does NOT sufficiently encapsulate the internals" of course...
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/E0BdR_AksiA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It's a nice idea to load your schema and data on every reset, if you can.
But if you need to, place you data anywhere under the :safe key in the system map and it will survive a reset.
Got it! :-)One more thing. While developing, I often have to deal with large amounts of data that take quite a while to load. However, the data is lost and so has to be reloaded after every reset, which is a bit annoying. Is there a way to prevent this?
--