Fork me on GitHub
#core-async
<
2016-03-11
>
jcromartie14:03:24

help me understand the relationship between core.async go blocks and threads

jcromartie14:03:53

it’s my understanding that a go expression is immediately run on some internal core.async thread pool

jcromartie14:03:17

and it will be parked and resumed as necessary but not on any particular thread

jcromartie14:03:36

we’re actually trying to parallelize some Amazon S3 requests

pbostrom14:03:27

@jcromartie: my understanding is that you should not use go blocks for blocking I/O, which I think S3 requests would qualify as; maybe use thread instead

jcromartie14:03:25

it still feels a little naive to just blindly kick off a thread to do potentially long blocking I/O

jcromartie14:03:31

we might have 2000 downloads

mccraigmccraig14:03:56

@jcromartie: afaics the AWS client supports asynchronous access - http://aws.amazon.com/articles/5496117154196801 - so you should be able to use it with core.async, or you might look into manifold which can straightforwardly adapt java futures

jcromartie14:03:52

yeah the AWS client has some neat features

jcromartie14:03:06

we want to go straight to memory not to disk though

jcromartie14:03:28

lots of good stuff there, thanks

ghadi17:03:31

core.async/thread doesn't spawn a thread

ghadi17:03:37

*necessarily. There is a pool

ghadi17:03:10

it just means try to run this function in the pool of threads made for real blocking

Alex Miller (Clojure team)18:03:11

but that pool is not fixed size

Alex Miller (Clojure team)18:03:29

so it will either spawn a thread or use one that someone else just finished with

settinghead19:03:31

which one is more suitable for handling db and request/response related operations? core.async, or pulsar? i heard someone argue that core.async is not built for IO read/write purposes, and that Pulsar is more suitable.

settinghead19:03:37

however i don’t know the underlying difference in how they achieve lightweight threads