Taking the comment on the question into account:
A transaction is being set up in the process of loading your namespace, and since it has a call to get-urls
at the top-level, the await-for
happens in that transaction and throws the exception.
The best way to fix that is to put the prn / get-urls
form inside a function and only call it once the namespace is loaded. (If you wanted to run this code as a standalone app, with lein run
or java -jar
on an überjar, you'd put a call to that function inside -main
.)
Incidentally, the transaction is set up when you use :reload-all
, but not without it. (See the private functions load-lib
, which checks for the presence of :reload-all
and decides to use the private function load-all
if it's there, and load-all
itself, which is where the transaction is set up. Here's a link to the 1.5.1 source.)