Hi Joachim, I suggest you create a component, C, that assocs a channel in the system map.
Now create a component, A that depends on C. A should start and stop a thread in the usual start/stop Lifecycle. The component should get the channel from the system map. The thread should check the resource, and if it changes, put messages on the channel. Components that are dependent on changes to the resource should also depend on C, start go blocks are read from the channel it provides. If you need multiple consumers, a pub/sub mechanism, all that stuff is provided by the core.async API. If you really need to automatically cause a reset, you can do that too - see the API in jig.reset, but it's rarely necessary. I don't think it's what you want to do in this case. Jig Version 2 is in RC status. This is mostly because the documentation (README) needs to catch up. As soon as I've fully updated the docs I'll release the final 2.0.0. Regards, Malcolm On 5 February 2014 10:19, Joachim De Beule <[email protected]>wrote: > Hi Malcolm, > > 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? >> > > Maybe this question is too broad, so let me ask some more specific > questions. All components should get/set their state from/in the system > map, right? Now the system map is a var defined in the user namespace. Does > this mean then that the resource-checking thread should alter the system > var? And then I guess it should also call user/reset? Or am I still > missing something here? > > BTW, not that I want to press you, but do you have any idea when you will > be finishing up version 2? I ask because it seems that the github code > currently is kind of in-between versions... > > Thanks again, > Joachim. > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > 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 > [email protected]. > 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 [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
