Fork me on GitHub
#datomic
<
2022-04-28
>
Benjamin11:04:39

what is the defaut way to implement 'reactiveness'? Do I have a loop that checks the current t of the database, then if it goes up it calls some handlers, possibly with the history since the last t ?

Joe Lane12:04:24

What are you trying to do?

Linus Ericsson12:04:00

in on-prem - either use the transaction log queue, or be clever when creating the initial data

Ivar Refsdal13:04:58

I think we need more context / details for giving a good answer. If what you are looking for is a persistent queue, you might want to try https://github.com/ivarref/yoltq, which it seems you already have starred 😃. yoltq uses https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/tx-report-queue to achieve "reactiveness". You may want to check that out as well. This is on-prem only.

Benjamin13:04:29

I currently work on a system that does not use datomic. What we do is querying aws redshift to make slack messages when something of interest happened in the system. I was just wondering how I would do it if it was datomic. 😅 I was thinking along the lines of there is a query group that reacts to new data in the db and then for example makes slack messages. -> now that I wrote it down I'm thinking that cloudwatch metrics and alarms might cover a lot of the use case

👍 2
Ivar Refsdal17:04:21

I did some error/recovery reporting in yoltq: If there is 3 consecutive error polls, i.e. errors in the database, then an error-callback will be invoked, triggering e.g. a slack message (or logging to ERROR as is the default). If the error persists, it will wait 1 hour before invoking the error-callback, so slack/logs won't be flooded. This isn't specific to Datomic though. Here is that code: https://github.com/ivarref/yoltq/blob/main/src/com/github/ivarref/yoltq/error_poller.clj Maybe too fancy/complex, I don't know.. 🤷

👀 1