Fork me on GitHub
#core-async
<
2021-02-23
>
bhaim12312:02:11

Hi, could there be a case that using core.async/<! will throw an exception?

Ben Sless13:02:17

if you're taking from an object which is not a channel

hiredman16:02:28

If you exceed the limits on the number of waiting takers

hiredman16:02:27

A take or put will throw an exception of you have more than 1024 pending operations against that channel

hiredman16:02:07

Which is, as far as I've seen, always a bug anyway

bhaim12319:02:14

Thank you both. @U0NCTKEV8 why 1024? where is this number coming from?

hiredman19:02:42

I think it is just sort of a magic number. high enough that you are unlikely to trip it with a non-buggy usage pattern, low enough that if have a run away process spinning up an infinite number of go blocks reading from a channel you will hit it

Ben Sless06:02:28

And inconvenient enough to trip up pipeline-async

bhaim12307:02:03

@UK0810AQ2 what do you mean?

Ben Sless08:02:24

pipeline-aysnc with parallelism of over 1024 will throw :man-shrugging:

👍 3