Fork me on GitHub
#core-async
<
2017-05-23
>
fabrao01:05:50

Hello all, I have a function that use clj-http to do this (http-client/get "" {:socket-timeout 3000 :conn-timeout 3000}). I don´t know why, sometimes the get don´t get response. Is there any way to do timeout to handle this?

noisesmith01:05:19

I don't think that's core.async related at all?

04:05:17

I use loop all the time in go blocks, often to manage state.

ray06:05:43

@tanzoniteblack was thinking about the recent presentation by @tbaldridge where he would like to see less core.async in 'normal' code

ray06:05:21

I'm happy with it, just wanted to see if I am breaking some new idioms

ray06:05:04

But, given the responses so far, I guess not

mpenet16:05:50

Is there an equivalent of doseq for reducibles usable in go blocks?

mpenet16:05:19

Or maybe doseq is actually optimized that way already

Alex Miller (Clojure team)16:05:59

No, doseq uses a sequence

Alex Miller (Clojure team)16:05:15

Is into with a map transducer not equivalent?

Alex Miller (Clojure team)16:05:26

and additionally, not sure what go blocks have to do with this

mpenet16:05:49

Well sometimes you use doseq in go blocks with a >! in the body for instance

Alex Miller (Clojure team)16:05:11

oh, something like run! maybe

16:05:22

Will not work

mpenet16:05:31

Run! takes a fn

16:05:23

oh, right

mpenet16:05:26

so no blocking put possible

mpenet16:05:49

You think it might be a worthy addition?

Alex Miller (Clojure team)16:05:09

I’m trying to bend my head around what it would be and whether it’s possible

Alex Miller (Clojure team)16:05:50

I think I would not even use doseq, I’d use loop

Alex Miller (Clojure team)16:05:26

but I don’t see how it would be possible to give a parkable procedure to a reducible and have that work with go

18:05:01

yes, reducibles are push-based, so they require their own dedicated thread to spin results onto a channel

joshjones21:05:39

@raymcdermott your post was yesterday but it’s an interesting topic — I think your intent is clear; either way, I’d make one fundamental change: instead of forcing core.async on your caller, requiring him/her to create a channel and pass it in, create one yourself, and return a function which, when called, terminates the loop — here is a gist which shows a few different ways to do that