Fork me on GitHub
#xtdb
<
2021-10-08
>
allandaviesza08:10:29

Seems like each time I use await-tx a thread is spawned? Is that correct? Nevermind, it must be blocking the calling thread which is causing something else to spawn new threads

allandaviesza08:10:13

If I listen for the ::xt/indexed-tx event, then receive a message for a certain transaction id, would that be the same as calling await-tx on that transaction id?

refset09:10:54

I'm pretty sure that's fine, yep :thumbsup:

🙏 1
allandaviesza08:10:15

I'm trying to make sure a transaction can be queried once a request completes without blocking the calling thread...

tatut08:10:35

I don't understand how do you wait without blocking?

tatut08:10:36

even if you have a listener, someone is presumably still blocked while waiting for the right event to fire

allandaviesza08:10:36

yea the request will be blocked, but I think the web server (Aleph) should handle that for me without creating a new thread. Where as if I block the calling thread, Aleph ends up spawning a thread for each request again, which I don't want

tatut08:10:34

haven't used, but you could hook the tx listener and manifold deferreds to do what you want I think

allandaviesza08:10:22

yea that's what I'm thinking

refset09:10:14

x-posting > We will continue our exploration of XTDB and Datalog. We will follow a XTDB tutorial on Nextjournal and do the exercises together. With discussions along the way. https://clojurians.slack.com/archives/C30SDJ58R/p1633645449001000

👀 1
xt 1
Steven Deobald18:10:36

In case you feel like xt is lacking exposure: https://twitter.com/xtdb_com/status/1446545506784710662

🙏 1