Fork me on GitHub

Hi! On NodeJS I'm trying to read and process huge backup files one S-Exp at the time without getting out of memory. So I guess I have to somehow implement IPushbackReader on Readable streams. Did somebody ever do something similar by chance?


Not sure if this helps, but JS has array buffers, which you can use to explicitly allocate and avoid GC. As always the best documentation is on MDN:


Thx. I'll try to use it somehow


Ah, great - I didn't see this


I have an async function in js, which is called with await foo(). How can I call foo in cljs?


(let [promise (foo)]
  (.then promise (fn [result] ...)))


Can I write HTML without any library like reagent in clojurescript?


I need to synchroneously wait for the result of a go block (due to a cljs-http call), is there a way to do that ?


You gotta restructure your code so it supports async stuff.

Sam Ritchie17:04:01

Huh, is there really no blocking get in core.async?


There is no blocking in CLJS, because there's no blocking in JS.

Sam Ritchie18:04:04

I would have expected it semantically to mean “don't move on until this form is done”


Well, you can fire off some code as a reaction to a result of a go block. Only that result->reaction part will be synchronous. But the whole app will be async - there will be other code running. That's why you can't just pass a result of a go block into a function - you have to restructure your code in such a way so that it works correctly in an inherently async environment.


thanks for the help!