Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printed output isn't returned to REPL until an expression is send for evaluation #49

Open
cemerick opened this issue Feb 14, 2014 · 2 comments
Labels
Milestone

Comments

@cemerick
Copy link
Owner

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.

@cemerick cemerick added the bug label Feb 14, 2014
@cemerick cemerick added this to the 0.2.0 milestone Feb 19, 2014
@tomjakubowski
Copy link

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=>

@cemerick
Copy link
Owner Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants