Hi all,
This follows a previous post I made (see here<https://groups.google.com/forum/#!searchin/clojure/stefon/clojure/rCmPYa0Vw-4/XZx1CIaoEB4J>). I was looking for a simple, Clojure-based blog engine that allowed me to stitch together components on an as needed basis. I didn't find one. And to that end, I decided to create a system with a very small kernel, which is wrapped by a simple plugin system. All interactions with the system basically just happen in-memory. While this is lightweight, it will only get interesting once we start attaching plugins, and listen for messages in the system. Thus, all other components are plugged into that kernel. I've gotten a small way towards that goal, and I'm getting ready to package up an initial proof-of-concept. While I was doing that though, I was hoping to get some architectural feedback from the community. I ultimately want to make it easy for people to write plugins for the this system. What do you think, and what do you want from this system? *Install & Run Tests * - go to your projects directory - `*git clone g...@github.com:twashing/stefon.git*` - `*git clone g...@github.com:twashing/stefon-datomic.git*` - go to stefon-datomic and `*mkdir checkouts; ln -s ../stefon checkouts/stefon*` ;; I'll push to Clojars once all is packaged up. Read more about the "checkouts" here<http://jakemccrary.com/blog/2012/03/28/working-on-multiple-clojure-projects-at-once/> . - To run either test suite, you can go to "*stefon*" or "*stefon-datomic*" and run `*lein spec*` *Overview * - Typical Workflow - - ;; basic, in-memory operation - (stefon.shell/start-system) - (stefon.shell/create :post "fubar one" "c" "c/t" "0000" "1111" nil nil) - (stefon.shell/retrieve :post {:title "fubar one"}) - - ;; Pluging in a component - (defn receive-fn [message] (println ">> message from the kernel > " message) - (def send-fn (stefon.shell/attach-plugin receive-fn) - (send-fn {:fu :bar}) - - ;; messages are lightweight - send any map you want; all other plugins will receive it (like being connected to a network) - ;; messages for which stefon listens, are configured here<https://github.com/twashing/stefon/blob/master/resources/config.edn> - - Use of lamina (vs. core.async): I basically went with Lamina<https://github.com/ztellman/lamina>, as it gives me the *channel-pair* function. This just returns a pair of channels, where all messages sent to one channel can be received by the other, and vice-versa. This is obviously used to communicate between the kernel and plugins. If I didn't use this, I'd end up writing something that did the same thing. I'd also be interested in something that gives me a more straightforward path in testing. And if I need to switch out Lamina, no plugin has to worry about changing any of their communication code. They just keep using the same *receive* and *send* functions. - Plugin scheme - message structure is very lightweight. You can send any map you want. And the traffic flow is open. So all other plugins will receive it (like being connected to a network). - And again, I chose to pass in and receive functions, instead of raw channels. If I need to switch out Lamina, no plugin has to worry about changing any of their communication code. They just keep using the same *receive* and *send* functions. *Todo * - Finish Documentation - have stefon pull in all configured plugins - deploy libs to Clojars That's it. If there's any setup or explanation that I've missed, please let me know. Hope this is something you find useful. Looking forward to your feedback. Cheers Tim Washington Interruptsoftware.ca / Bkeeping.com -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.