by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Matthias Nehlsen
@matthiasn
If I understand correctly, all this would happen in the backend, right? If so, you could place a channel inside the message payload, send this message with the channel to both a DB prefetch component and somewhere else. Then when the DB has prefetched the data, it puts it on the channel, which can then be taken of the channel somewhere else. Does this make sense?
Daniel Cox
@danielpcox
I would also love to read that documentation. :) Your use of component and core.async together in BirdWatch changed the way I write systems, but I almost immediately started wanting some macros to help cut down on the component boilerplate. systems-toolbox looks great.
I'm interested in helping you build it (or maybe write some documentation), though I won't be very free for a week or two.
Matthias Nehlsen
@matthiasn
Hey Daniel, cool, that's great! Sure, let me know when you have time. Either here or via email, it's on my github account. Cheers
Matthias Nehlsen
@matthiasn
Hi, I created a new version, see the commit comment for further details. Feedback most welcome. Cheers matthiasn/systems-toolbox@695bb1f
Best to comment on #24
Daniel Cox
@danielpcox
Sweet. I'll check it out soon.
Daniel Cox
@danielpcox
Hey Matthias, I just got an email saying that the Clojure/conj call for proposals is ending soon, and it occurred to me that there's actually nothing I'd like to see a talk on more than "Building Systems in Clojure" and systems-toolbox. Have you considered submitting a talk?
Matthias Nehlsen
@matthiasn
Hey Daniel, no I haven’t as of yet, but that’s a good idea. Let me see if I can put something together this week. Cheers!
Daniel Cox
@danielpcox
Cool. I've :+1:'d you in the #events Clojure Slack channel.
Daniel Cox
@danielpcox
Sorry for the spam, but "The Clojure/conj CFP closes tomorrow! Submit here. Speakers will be announced on September 11, 2015." Did you submit? :P
Matthias Nehlsen
@matthiasn
Hey Daniel, thanks for the reminder :-) not yet, but I will before sunset
Daniel Cox
@danielpcox
Thanks ;)
Deus Eks
@jamesnyika
@matthiasn Yes. You are correct and that is exactly what I am doing. It works for now. However, I am noticing that I need a way to build cyclic connections between components and also sometimes some components in a chain do not have work, they literally will just pass the payload over to the next component. Here is a suggestion that would really help: the code for the switchboard and component is not as readable and sometimes I have difficulty understand all the options that I have with it. If you get a chance to detail how the different options can be useful, it would really make it helpful to me. I hope the others on the chat agree. What a tool this is.. very very nice!
Matthias Nehlsen
@matthiasn
@danielpcox talk submitted :-)
Matthias Nehlsen
@matthiasn
@jamesnyika the documentation will have to become much more complete very soon as we’ll be using this library for a large-scale backend application at work. This is really cool as I’ll be writing it for work and not in my limited free time, and there will be deadlines attached to that task, which I usually find very helpful for getting such a task done.
Also, we now have a cool chrome developer tools extension for the library which allows for the inspection of messages and state right inside the devtools. I’m hoping to have a blogpost on that before the end of the month.
Deus Eks
@jamesnyika
@matthiasn - that is fantastic. Please let me know if there is anything special you end up doing with the framework. I myself am building a server back end for multiple mobile applications and I would appreciate any shared information you can provide. I will do the same myself.
john ervine
@johnboy14
Hi @matthiasn - Is it possible to select a component based on the contents of a message?
e.g [:cmd/route-all {:from :client/mouse-cmp :to :client/ws-cmp :type "blahblah"}]
Matthias Nehlsen
@matthiasn
Hi @johnboy14, sorry, just seeing this, somehow I did not get a notification. Right now not, that's only possible for :route, not :route-all. It would be possible to add this functionality though, by internally using a filtering transducer on the channel. I'll have a look.
Probably best in general to add an issue on GitHub for feature request.
Thanks for the suggestion, will add a ticket.
kamituel
@kamituel_twitter
Hey Matthias!
Just wanted to let you know that I published new version of Chrome extension that works with recent systems-toolbox. It got broken due to :msgs-on-firehose and :snapshots-on-firehose being being introduced, and being false by default.
(cc @matthiasn)
Matthias Nehlsen
@matthiasn
Hey Kamil, that's great, thanks! I'm thinking maybe the firehose should rather be enabled or disabled globally, like a dev mode or something, and not on a per-component basis. What do you think?
Also, I'm thinking about a chapter in the book that introduces the chrome extension, once I'm done with the WS latency thing. Probably next week, or the week after. I'll ping you. Cheers
Kamil Leszczuk
@kamituel
This Gitter thing is driving me crazy, why wouldn't I get any notification on a message?
Anyway, of course, that's something worth mentioning in a book. I continue to use extension quite often.
javier abanses
@nrfm
Hi Matthias, thanks for all the work on the project. one question, is there a way to "add componets at runtime"?
as in adding views to the switchboard in cljs .
nevermind.... i answered my own question.. :) YES
Kamil Leszczuk
@kamituel
Hey Matthias, how are you keeping?
I need some change in systems-toolbox-sente and was wondering how to approach that.
Specifically - I'd like to have an API handler without CSRF protection. On all other handlers, I'd like to have CSRF middleware applied. And also - all endpoints should listen on the same port, of course. Currently, systems-toolbox-sente (we're on 0.5.x, but that's the case on 0.6.x as well AFAIK) wraps everything in ring-defaults middleware, so there' s no way to disable CSRF for specific endpoint(s).
systems-toolbox-sente already exposes some conf options around that: middleware, routes-fn.
Kamil Leszczuk
@kamituel
How about changing that a bit so that it's possible to accomplish what I need, and keep things simple? My idea would be to get rid of routes-fn and middleware-fn, and replace them with a single conf option: middleware-fn that would accept put-fn and cmp-routes. Just like that, not wrapped in defaults.
This function would have to return proper routes/middleware, so it would need to wrap cmp-routes in defaults, if needed. Or would do this only for selected routes, but not for all.
Well, actually, maybe that's too flexible. After all, we want to have CSRF on for cmp-routes always, do we?
Let me express what I want to do in pseudocode, it'll be easier ;)_
This is what systems-toolbox-sente does now:
(let [user-routes (routes-fn {:put-fn put-fn})
      cmp-routes [(GET "/" ...)
                  (GET "/chsk" ...)
                  (POST "/chsk" ...)]
      cmp-routes (into user-routes cmp-routes)]
  (let [ring-handler (rmd/wrap-defaults cmp-routes ring-defaults-config)
        wrapped-in-middleware (if middleware (middleware ring-handler) ring-handler)
        server (immutant/run wrapped-in-middleware (undertow/options undertow-cfg))]
    ...))
Kamil Leszczuk
@kamituel
Instead, I'd propose:
(let [cmp-routes [(GET "/" ...)
                  (GET "/chsk" ...)
                  (POST "/chsk" ...)]
      ;; Routes created by systems-toolbox-sente are always CSRF protected,
      ;; and have all other defaults.
      ring-handler (rmd/wrap-defaults cmp-routes ring-defaults-config)
      ;; Now add any user middleware / routes to the mix.
      with-user-middleware (middleware-fn put-fn ring-handler)
      server (immutant/run with-user-middlewre (undertow/options undertow-cfg))])
Hmm, maybe if I tag you, you'll get a notification? @matthiasn ;)
Kamil Leszczuk
@kamituel
Hm, just noticed it would mess with default routes a bit ("/" and "not found"). I guess it's not a big deal and can be solved somehow
Matthias Nehlsen
@matthiasn
Hey @kamituel, updated my notification settings, we'll see if that helps in the future. Sure, sounds good, I'd have a use case for that, too.
Matthias Nehlsen
@matthiasn
Hey @kamituel , thanks for the PR, I merged and published it, see https://clojars.org/matthiasn/systems-toolbox-sente/versions/0.5.24
gzll
@gzll
@matthiasn hello, are you still updating your book? I saw you new push in github.