Fork me on GitHub

Does anyone know of a good library for API throttling which can handler bursts, limit requests per IP, etc.?


This can handle bursts and limit requests by IP you can add probably add manually:

👍 4

Thanks but I ended up using diehard ( though. throttler current version is running on quite an old version of clojure, so I was facing difficulty incorporating it in my project.


Is there a way to make a new record type that extends existing one?


From what I can tell it's recommended to use multimethods:


but that also sounds suspicously like oop 🙂

🙂 4
Alex Miller (Clojure team)12:09:06

@nooga intentionally, no. per - the first item there is “concrete derivation is bad”

Alex Miller (Clojure team)12:09:25

which I think states Rich’s opinion on this pretty clearly :)


yeah, I’m asking because I’ve never done it and never intended to


I’m having a component which obviously implements component/Lifecycle let’s say it’s a kafka producer, and I want other components to have that injected as a sink, so that they can call a “method” on it, like (send (:sink myself) some-data).


so that the sender doesn’t care what’s a sink as long as it implements some Sink protocol


thing is, I’d like to have a couple of those kafka producers, each one with different Sink implementation


alternatively I could just put an async channel there and supply a mapping fn when creating those?


don’t know how to approach that


must be some way to do with extend-type or reify, no?


@nooga I didn't quite understand your problem, but you might wanna check out #aleph ( and manifold(aleph's dependency). You can depend on the stream abstraction instead of a concrete impl like core.async Here's the rationale:


yeah, I know aleph, haven’t thought of it though


@coinedtalk that’s what I’m thinking

Karol Wójcik20:09:18 Could someone please explain me why cider-connect on lein repl with host works whereas with host it's not working? How it's possible?

Karol Wójcik20:09:43

I mean in both cases cider tries to connect with localhost

Karol Wójcik20:09:54

so it should work perfectly fine in both cases


@kwcharllie379 are you asking about docker? or are you having this issue with lein repl outside of a container?

Karol Wójcik20:09:34

I think that I'm asking about docker specifically.


I’m guessing it has something to do with the way docker maps ports


@kwcharllie379 if you start lein repl on host, it's only listening on the loopback address which is only accessible within a machine. You need so it listens on all IP addresses assigned to that machine. So you have to use inside Docker for the REPL to be accessible outside Docker.


The same is true of starting up lein repl on remote servers in general (and also for when you're programmatically starting nREPL servers inside your apps).

Karol Wójcik21:09:47

Now I got it ;) thank you very much @seancorfield