Thanks for the report. Schema fns inside of go blocks seem to work fine for me. It seems likely that you're seeing an exception inside the go block, which is swallowed by default:
user> (clojure.core.async/go (println "A")) #<ManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@46ae10a6> A user> (clojure.core.async/go (throw (RuntimeException.)) (println "A")) #<ManyToManyChannel clojure.core.async.impl.channels.ManyToManyChannel@427c78c1> Would you mind wrapping the body of your go block in a try/catch and printing the exception stack trace, or posting a gist that demonstrates the issue so I can look into it further? Thanks! On Friday, January 3, 2014 10:21:16 AM UTC-8, frye wrote: > > Forwarding... > > ---------- Forwarded message ---------- > From: Timothy Washington <[email protected] <javascript:>> > Date: Fri, Jan 3, 2014 at 1:17 PM > Subject: Re: Core.async, Rules for passing clojure vals to go block > To: Shaun Gilchrist <[email protected] <javascript:>> > > > I'm using Prismatic's Schema in my code base. Now, it looks like defining > some functions with > s/defn<https://github.com/Prismatic/schema/blob/master/src/clj/schema/macros.clj#L453>, > > yields some wonky behaviour. Particularly, not running, when being invoked > in a go block. It just fails silently, which is why it was so hard to track > down. Don't yet know why this is happening. But an fyi for the devs and > users of this package. Still love schema, I just need to figure out where > the call chain breaks down. > > > Hth > > Tim Washington > Interruptsoftware.com <http://interruptsoftware.com> > > > On Fri, Jan 3, 2014 at 9:58 AM, Timothy Washington > <[email protected]<javascript:> > > wrote: > >> Hey Shaun, >> >> Thanks for looking into this. Your example does indeed work. I'll have to >> teardown my own code and see where the invocations are failing. At least I >> know it's not core.async. >> >> >> Cheers >> >> Tim Washington >> Interruptsoftware.com <http://interruptsoftware.com> >> >> >> On Thu, Jan 2, 2014 at 4:16 PM, Shaun Gilchrist >> <[email protected]<javascript:> >> > wrote: >> >>> Hey, I am attempting to duplicate the issue you described in the email >>> here: http://cljsfiddle.net/fiddle/shaunxcode.timothy-example and it >>> seems to work for me - granted I am doing this in cljs so maybe it is >>> different for clojure? >>> >>> >>> On Wed, Dec 25, 2013 at 7:35 AM, Timothy Washington >>> <[email protected]<javascript:> >>> > wrote: >>> >>>> Hi there, >>>> >>>> For core.async, what are the rules for, *i)* having vals from a >>>> function closure, *ii)* passed into a go block. In the example below, >>>> I cannot pass in the system-atom to the handle function. The call will >>>> just >>>> die silently, without throwing any exception. Instead, I have to pass in a >>>> nil for the function to be invoked. >>>> >>>> Is this expected behaviour? Is it a bug? I would've expected an >>>> exception to be thrown if that's forbidden. >>>> >>>> (fn [system-atom handlefn] >>>> >>>> >>>> >>>> >>>> >>>> (println "sanity check: " system-atom) >>>> >>>> (go (loop [msg (<! chanl)] >>>> >>>> >>>> >>>> >>>> ;; (handlefn system-atom msg) >>>> (handlefn nil msg) >>>> >>>> >>>> >>>> >>>> (recur (<! chanl))))) >>>> >>>> >>>> Thanks >>>> >>>> Tim Washington >>>> Interruptsoftware.com <http://interruptsoftware.com> >>>> >>>> > -- -- 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.
