Implicit casting of context objects?

39 views
Skip to first unread message

J Irving

unread,
Jun 18, 2014, 11:22:15 AM6/18/14
to clojure...@googlegroups.com
Hi

I have a quartzite job that is making use of a function which is actually a method on a record which implements a protocol. I attach the record instance to the job as a value in a map. Inside the job, when I retrieve the record it appears to have been cast to a clojure.lang.PersistentArrayMap. This breaks dispatching for the method call.

I haven't visited the sources yet (I'll get to that next), but the first question is: Is that what's happening here? And second, if so, is there any way around this?

cheers, J

J Irving

unread,
Jun 18, 2014, 11:32:18 AM6/18/14
to clojure...@googlegroups.com
To be clearer - the map I put the record into is the job context, and it's attached with 'using-job-data'. Sorry if that was unclear.

Michael Klishin

unread,
Jun 18, 2014, 10:45:22 PM6/18/14
to clojure...@googlegroups.com

2014-06-18 19:22 GMT+04:00 J Irving <jonatha...@gmail.com>:
I haven't visited the sources yet (I'll get to that next), but the first question is: Is that what's happening here? And second, if so, is there any way around this?

Clojure records *are* maps. You get an unexpected conversion somewhere, possibly in Quartzite. You can always instantiate
a record from a map using map->RecordName (a function that the Clojure compiler automatically generates).
--
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

J Irving

unread,
Jun 18, 2014, 11:59:32 PM6/18/14
to clojure...@googlegroups.com
True that, but unfortunately this particular record is a component (in the Stuart Sierra sense), and encapsulates some mutable state.

For now I have switched to a much lighter-weight solution (I'm using overtone.at-at) because my requirement is fairly trivial, but I'm still interested in whether there's a general solution to this.

cheers, J


--

---
You received this message because you are subscribed to the Google Groups "clojure-quartz" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-quart...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages