Fork me on GitHub
#clara
<
2020-09-07
>
sparkofreason13:09:44

What would be the most efficient way to get notified when results of a specific query have changed?

wparker08:09:48

Clara computes query results upfront; when you call (query session ….) you’re basically just doing map lookups. https://github.com/cerner/clara-rules/blob/main/src/main/clojure/clara/rules/engine.cljc#L1998 So I don’t think different ways of doing this would have much difference in terms of performance; you’d probably want something that stores the previous state, calls query on the session, and then compares them.

sparkofreason22:09:38

I was thinking more in terms of getting notified per query only when the results changed. I'll look at doing it with a listener.