rixed / ramen

A stream processing language and compiler for small-scale monitoring
Other
14 stars 4 forks source link

Simpler notify stanza #1393

Closed rixed closed 2 years ago

rixed commented 2 years ago

Instead of notify being controlled by the where-clause of a function, which pretty much mandates to have one new function per notify, have a conditional notify (notify "Panic!" when...) that is triggered only when that condition is met. The current notify could become syntaxic sugar for notify "Panic!" when true.

Then, a special field boolean non nullable field named 'ok' or 'firing' would be automatically turned into 'notify "$the field docstring" when changed(ok)'.

rixed commented 2 years ago

Cons: Current RaQL can implement the same behavior and more (such as notifying on any random condition, such as when a particular combination of events is noticed, not only when something's health deteriorate). We could easily enough detect all cases of a functions output having a boolean ok field and add a function notifying on it.

Regarding the optimisation: that's another matter entirely. Combining several functions into just one is something that we want ultimately anyway, regardless of it being a notify or not.