fireplace blocks until expression terminates

38 views
Skip to first unread message

Scott Thompson

unread,
May 6, 2014, 12:06:47 PM5/6/14
to vimcl...@googlegroups.com
I'm using fireplace.vim to run expressions in my clojure code. One of my expressions iterates through a large result set from a database query. As I iterate through the result set Im printing to console to keep track of progress:

(doseq [item result-set]
 (println "progress!")
 (do-something item))

When I run this expression with fireplace it will lock my vim session until the code finishes executing at which point I will see all the output. Is there a way to have fireplace 'tail' the output so I can get live feedback as the code is executing?

guns

unread,
May 7, 2014, 2:56:11 PM5/7/14
to Scott Thompson, vimcl...@googlegroups.com
If all you want is to see logging output, you can always print directly
to System/out so that it appears in the `lein repl` console. The fact
that fireplace captures *out* but not System/out is quite handy.

If you want to achieve asynchronicity, that is a longer discussion. You
may want to check out vim-redl by David Greenberg, as the provided repl
will return control to Vim after a timeout.

Otherwise, you can do what I do and create a little eval wrapper that
wraps expressions in a future, and swaps the future into an atom of
async expressions that you can query later.

HTH!

guns
Reply all
Reply to author
Forward
0 new messages