austin
austin copied to clipboard
Printed output isn't returned to REPL until an expression is send for evaluation
e.g. if a callback is printing to *out*
via println
, prn
, etc., that output isn't returned to the REPL until another expression is sent for evaluation. This is due to the synchronous request/response model of the communication channel…a very reasonable thing for evaluation results, but very counterproductive w.r.t. printed output.
Not sure this can be readily addressed as long as we're using the CrossPageChannel
, with agents server-side to serialize responses. SSE + regular XHR (as discussed in #47 and elsewhere) would solve this, though that implies significant re-work.
Nitpicking (but perhaps helpful nitpicking): I don't think an expression needs to be sent to the browser for evaluation in order to see the printed message. For example:
cljs.user=> (js/setTimeout #(println "Hello, world"))
56
cljs.user=> ; user hits <RET>
Hello, world
cljs.user=>
Yup, you're right. This is being caused by some kind of buffering, either in piggieback, or in Austin's "constrained order" evaluation mechanism (which I don't fully understand, was inherited from ClojureScript's stock browser-REPL backend).