This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-11
Channels
- # adventofcode (1)
- # aleph (1)
- # announcements (3)
- # babashka (39)
- # beginners (84)
- # calva (1)
- # cider (17)
- # clj-kondo (15)
- # cljs-dev (43)
- # clojure (132)
- # clojure-dev (1)
- # clojure-europe (4)
- # clojure-nl (7)
- # clojure-norway (4)
- # clojure-uk (22)
- # clojurescript (56)
- # clojurex (24)
- # cursive (11)
- # data-science (2)
- # datascript (33)
- # datomic (7)
- # docker (2)
- # figwheel-main (11)
- # fulcro (2)
- # jobs (3)
- # joker (29)
- # leiningen (3)
- # nrepl (4)
- # off-topic (11)
- # planck (4)
- # reitit (5)
- # ring (4)
- # shadow-cljs (205)
- # spacemacs (5)
- # xtdb (9)
Hello, Cruxians... I have a question for ya Situation : Testing - during test run I don't have direct access to Crux node, but given the tests are run on the same VM and same file system where Crux node runs, is there any good nice way how to access and "listen" to evens on Crux during testing. The big problem I have is that currently I am forced to put Thread.sleep(...) in my tests between writes and reads from crux, but I would like to have consistent and deterministic test and have test continuation after I am sure crux has written stuff in the DB. So my idea was - something to listen on crux log or wherever Crux writes in FS for events. Any good idea?
Hi Janis, sorry for long response.
Sure, you can just use sync
, it was made for that.
@olekss.janis Hi - just to add to @U0A5V8ZR6’s answer, I think you could use the http-server-server and remote API to do the sync
conveniently. Or you could expose the sync
functionality from the node using your own API
@olekss.janis it's no problem, though Slack logs disappear so quickly these days! sync
blocks until the node has ingested the tx-time
you give it (which you want to pull out from the sumbit-tx
response), otherwise the node may not have processed transaction yet
@olekss.janis sorry, I could’ve been more helpful
sync
docs part https://juxt.pro/crux/docs/api.html#_sync
If you share your test setup we can be more helpful
Does crux have any aggregates? I'm looking for count.
Hi! We have an aggregation "decorator" which allows you to add all sorts of interesting reducers (including counting) to the output of the core datalog responses. For an example of usage, see https://github.com/juxt/crux/blob/master/docs/example/repl-walkthrough/graph-traversal.clj#L110-L118
@olekss.janis sorry, I could’ve been more helpful
sync
docs part https://juxt.pro/crux/docs/api.html#_sync
If you share your test setup we can be more helpful