Fork me on GitHub
#clojure
<
2020-01-11
>
murtaza5208:01:32

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)

leonoel08:01:33

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

alfredx08:01:28

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

andy.fingerhut10:01:01

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
murtaza5215:01:10

@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 ?

andy.fingerhut18:01:32

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

murtaza5213:01:48

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

murtaza5217:01:13

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.

andy.fingerhut18:01:44

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

andy.fingerhut18:01:57

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.

algoshipda10:01:52

how can access enum like org.jsoup.select.NodeFilter.FilterResult ?

Hi11:01:55

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

littleli12:01:07

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?

sogaiu14:01:18

@ales.najmann danielcompton has written on java 9 and 11 wrt clojure - here is one of the docs: https://www.deps.co/blog/how-to-upgrade-clojure-projects-to-use-java-9/ - i think some of what you asked about is touched on in there

👍 8