Fork me on GitHub
#core-async
<
2018-05-01
>
lxsameer20:05:23

hey folks, what's the different between put! function in async.clj and the one in ioc_macros ? in blocking and parking version ?

hiredman21:05:20

there put! in ioc macros is a helper for the macro when implementing >!

hiredman21:05:31

it is a completely different function that happens to have the same name

lxsameer21:05:50

so the put! in ioc is actually >! and put! in async.clj is meant to be used outside of go block, am i right ?

hiredman21:05:01

async/put! is non-blocking so you can use it in a go block

lxsameer21:05:28

can or should ?

hiredman21:05:39

it is both non-blocking and non-parking, which can be problem

hiredman21:05:09

you don't get the back pressure from blocking or parking

lxsameer21:05:22

hmmm i just got confused

hiredman21:05:31

I would recommend against using put! unless you know for sure the channel has capacity. For clojurescript sometimes there is no alternative. If you do you use put! you may want to use the arity that passes in a callback that is called when the put completes, ad use that for back pressure

lxsameer21:05:21

aha I guess i got it