This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-07
Channels
- # aleph (10)
- # announcements (6)
- # architecture (23)
- # atom-editor (2)
- # beginners (35)
- # biff (5)
- # cljdoc (22)
- # clojure (14)
- # clojure-europe (18)
- # clojure-hungary (26)
- # clojure-nl (6)
- # clojure-uk (6)
- # clojurescript (39)
- # core-async (1)
- # data-science (14)
- # datascript (20)
- # datomic (4)
- # graalvm (18)
- # jobs-discuss (5)
- # keechma (1)
- # leiningen (4)
- # malli (3)
- # nbb (11)
- # nextjournal (2)
- # off-topic (1)
- # parinfer (1)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (7)
- # sql (2)
- # xtdb (4)
is there a way to make a kind of lazy source in core.async, to create a value only when <! (take) was called on a channel?
are you sure you need core async ? because it feels like you could just consume your lazy source
Make an eager go-loop
that puts onto a channel with no buffer.
It will do what you're asking in effect, except that it will precompute each element when the previous one was taken.
"when the previous one was taken" that's exactly what i'm trying to get around of, the element is computed from a http request, which shouldn't be made in advance
reverse the backpressure. have two channels. put on one some token indicating you are ready. have the producer make the request and send the response back on the other channel
Whats the trade off between sharing a https://http-kit.github.io/client.html between requests or creating a new one each request? The docs say it' "lightweight" but I don't really understand what that means. I see it says that a "TPC connection and SSLEngine get reused if possible" how does a system make that possible? Thd docs say "it" (i assume the clients) wants to keep a TCP connection alive for a while... that implies i want to share the client between requests right? The way of expressing that with a deref is interesting:
; keepalive for 30s
@(http/get "" {:keepalive 30000})
; will reuse the previous TCP connection
@(http/get "" {:keepalive 30000})
; disable keepalive for this request
@(http/get "" {:keepalive -1})
lightweight usually means using coroutines instead of spawning a thread for each requests keepalive adds a tiny amount of TCP calls, if you were to do a single request, but save a usually bigger amount of network calls by avoid the necessity to run the TCP handshake for each request. The single client thing is done behind the hood, upon your first request. Though you can manually create and use one if you want.
> The single client thing is done behind the hood, upon your first request.
Would you do that by calling new
on org.httpkit.client.HttpClient e.g (HttpClient. (some configuration?)
what skills do i need to get a job writing clojure? im aiming at general software engineering roles and backend roles. i have a background in common lisp and scheme. I know enough common lisp to write a compiler. I have once. so thats kind my background. i dont have real world experience but I have gotten interviews before for clojure roles. thanks
This is a good topic for #jobs-discuss rather than #clojure
Cool. Now it's posted there, I've deleted it from here. Thank you!