Fork me on GitHub

does the comp in transducers behave differently (the fns are executed from left to right), as compared to regular comps (fns are executed right to left)


comp is always right to left. It feels backwards for transducers because the argument of the resulting function is a reduction stage, not the value itself


As it is known that pmap ’s parallel level is somehow limited by number of cores of the machine, is there a way to simply specify a number and go beyond the limit? For example, (pmap 100 f (range 1000))that runs 100 threads


pmap does not give much control over anything. claypoole and/or using the Java Executors framework directly give you more control, and are not terribly difficult to learn.

👍 4

@U0CMVHBL2 I want to do IO operations concurrently. If I use claypoole, lets say initialize a threadpool of 5, however I have a single core processor. For IO I am using blocking clj-http.client/get wrapped in an claypoole/future so will my cp-threads still get interleaved, or will they get blocked due to the blocking nature of IO ?


a thread that does a blocking IO call will be blocked, but any other threads that are not currently blocked should be able to make progress


@U0CMVHBL2 so does that mean that in my above scenario I will never get 5 concurrent http calls ? How do I achieve that ?


What I mean is that once the http-call is made and the thread is waiting to receive the response. During this interval my assumption is that the thread will not be blocked, bcoz its waiting for the OS to respond back with the result from the network call.


In your above scenario you should get 5 concurrent http calls.


After 1 thread makes a blocking call (any blocking call), that 1 thread is blocked, but if there are 4 other threads that are not waiting for a blocking call to return, then the other 4 threads should be runnable and can make progress, and the OS scheduler should cause that to happen for you.


how can access enum like ?


Hi. How to find this (:import [com.sun.jna Library Native Platform] in Github what lib provides this ?


I'm almost afraid to ask. What's the deal with Java 9+ platform modules? What kind of challenges are there for us as Clojure developers? Is it a threat or we are ok? Is there a summarized informations about this topic?


@ales.najmann danielcompton has written on java 9 and 11 wrt clojure - here is one of the docs: - i think some of what you asked about is touched on in there

👍 8