nrepl / weasel

ClojureScript browser REPL using WebSockets
The Unlicense
324 stars 35 forks source link

Executing some code before blocking #63

Closed piranha closed 9 years ago

piranha commented 9 years ago

Hey! So I'm trying to get current cljs, piggieback and weasel running using boot-cljs-repl. And it does one interesting thing: it writes port for the running server in a .cljs file, which is then read by a client, which then connects to a server.

But current version of weasel started blocking (using server/wait-for-client), so boot-cljs-repl never gets control back, which means it can't write port to the file (if the port was not supplied - and chosen randomly by http-kit), which means client never connects - so that's a dead end. :)

I was thinking about solution and what came to my mind is some kind of init function, passed as an option to websocket/repl-env function. Maybe with a different name, but just called before server/wait-for-client function here. What do you think?

piranha commented 9 years ago

Just in case, I implemented this here.

tomjakubowski commented 9 years ago

Hey! I think we can close this now that #65 is merged. Thanks again!