onyx

FYI: alternative Onyx :onyx: chat is at <https://gitter.im/onyx-platform/onyx> ; log can be found at <https://clojurians-log.clojureverse.org/onyx/index.html>
sparkofreason 2018-06-25T20:54:53.000452Z

I have some tasks which take config data as an argument. That config data has changed, but when the job is resumed those tasks still use the old config values. Is there a way to update this sort of info when using resume points? Or should I be using a different method to obtain this config data so stale values aren't used when the job is resumed?

lucasbradstreet 2018-06-25T21:58:13.000363Z

That’s odd, but it will completely depend on how you’re injecting the config data. Is it being placed into window state somehow? Otherwise I’m not sure how it could get the old values unless there was a mistake somewhere

sparkofreason 2018-06-25T22:08:13.000469Z

I believe it is only injected as args on task functions. I'll double-check if it's leaking through anywhere else.

lucasbradstreet 2018-06-25T22:11:48.000037Z

If that’s the case, I have no idea how it could happen as they are inject directly from the new job’s data at the time the peers start on the job

sparkofreason 2018-06-25T22:34:48.000285Z

Are non-segment task arguments remembered at all? I've gotten errors when they were not serializable, but again perhaps that was because I let them get into some other portion of the state.

sparkofreason 2018-06-25T22:40:01.000073Z

Hmmmm, I just found where I added that info to a window definition map as a hacky way of making it available to make it available to an emitter function. That's probably a bad practice.

lucasbradstreet 2018-06-25T22:41:28.000153Z

yeah, that’s probably where it all went wrong. I prefer to just get at that data from the event map which is under :task-event in the state event map

lucasbradstreet 2018-06-25T22:41:39.000199Z

assuming you only need it in the the windowing code

sparkofreason 2018-06-25T22:45:25.000046Z

Not quite following there. I need some Datomic configuration data to be able to run a query in the emit function assigned to a window. Can that be made available in the job definition, or does it have to be passed through by some other mechanism?

lucasbradstreet 2018-06-25T22:47:35.000366Z

Trigger emit gets passed the window map, trigger map, as well as the state event map http://www.onyxplatform.org/docs/cheat-sheet/latest/#trigger-entry/:trigger/emit

lucasbradstreet 2018-06-25T22:48:42.000371Z

So you can put that datomic config data in either the window map, trigger map (each passed in), or you can stick it in the task map, which you can get from the state event map under :task-event :onyx.core/task-map http://www.onyxplatform.org/docs/cheat-sheet/latest/#state-event/:task-event

sparkofreason 2018-06-25T22:56:21.000298Z

Thanks, put it in the task map, worked great. Hopefully that should ensure I get the latest config values on restart.