Wrote down some notes on http client and server here: https://github.com/borkdude/babashka/issues/628
> http-kit keeps the whole response in memory
this kind of surprising to me. is this an artifact of the how it's implemented/added into bb? you should be able to use {:as :stream}
to get a bytestream on any request
see: https://github.com/http-kit/http-kit/blob/master/src/java/org/httpkit/client/RespListener.java#L136 and http://http-kit.github.io/client.html (search for "output coercion")
no, it's just how http-kit implemented it. it has nothing to do with bb
you will get the stream, but not until it's fully realized in memory first
yeah i was just looking at that code
that's kinda surprising, honestly. good find
But you can use babashka.curl for big streams. I hope it will get fixed eventually in http-kit but it's been like this for years apparently
This project works with bb: https://github.com/ordnungswidrig/sha-words It translates SHAs or UUIDs in human-readable words
wow, that's cool (the lib and BB support)
It just happened to work with bb, it wasn't designed like that btw :)
so, there is now a Raspberry Pi with 8GB of memory. Should be sufficient to get babashka compiling on such a machine https://www.raspberrypi.org/products/raspberry-pi-4-model-b/?resellerType=home
Nice, I was going to ask. I've been using the jar on mine for now.
@mathpunk I saw a question about babashka.process, and I was going to give an example, but I saw you removed it. Posting it anyway.
user=> (def cat-proc (babashka.process/process ["cat"]))
#'user/cat-proc
user=> (def writer (io/writer (:in cat-proc)))
#'user/writer
user=> (binding [*out* writer] (println "hello"))
nil
user=> (binding [*in* (io/reader (:out cat-proc))] (read-line))
"hello"
oh thank you! i had a moment where i felt self-conscious and like i should go answer it via documentation
the last line shows how you can read lines from a process and wait for certain output
this is very helpful thank you!
Am I doing something wrong, is java.security.SecureRandom
not in babashka? java.security.MessageDigest
is included
Not a biggie of course, just checking