This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-13
Channels
- # beginners (17)
- # boot (16)
- # cider (13)
- # cljs-dev (26)
- # cljsrn (5)
- # clojure (155)
- # clojure-belgium (2)
- # clojure-spec (19)
- # clojure-uk (4)
- # clojurescript (32)
- # community-development (16)
- # core-async (12)
- # cursive (3)
- # datomic (7)
- # hoplon (14)
- # lambdaisland (1)
- # lumo (16)
- # microservices (1)
- # off-topic (3)
- # om (5)
- # onyx (4)
- # protorepl (1)
- # re-frame (1)
- # rum (1)
- # specter (6)
- # unrepl (32)
i am trying to do queue with async
, but it confuse me. I have queue and i want get from this queue max 20 items on each iteration (when 10 items i want get 10 items and do job, not wait for 20). How to do it in most simple way? After each iteration i want do X seconds of break.
kwladyka: looks like you need two channels, one for data and another for iteration control. so when you get input from control channel then you process up to 20 items from data channel and so on.
also it's possible that for you task the algorithm is not a best but from your description is not clear why algorithm is like you described.
it is because i can’t flood server with requests, server get max 20 items at once in request
@U0WL6FA77 so you can use async/pipeline functions for guaranteed processing of limited amount of items simultaneously https://clojuredocs.org/clojure.core.async/pipeline-blocking
@U0WL6FA77 there are also libraries like https://github.com/brunoV/throttler
Do you have example of use pipeline-blocking
? I was trying to find something in google but didn’t find.
what about this? https://gist.github.com/raspasov/7c9d8f2872d6065b2145
kwladyka: looks like you need two channels, one for data and another for iteration control. so when you get input from control channel then you process up to 20 items from data channel and so on.