This is a caused by an interesting interaction of two things: 1) channels
can have no more than 1024 pending takes at a time. and 2) (timeout)
"caches" it's return value for a given ms + window size of time. At the
moment, window is about 5-10ms.

This error message is normally the result of a bug. That is to say, if you
have 1024 pending (not buffered, but actual blocking) takes/puts, then
normally your system is not considering back pressure in some way. So we
created an arbitrary limit imposed to keep people from writing bad code. If
you think of it, pending takes/puts can create unbounded queues on the
input/output of a channel. This is an attempt to make that queue size
bounded.

However, in your problem you have something else going on as well. In order
to make calls to timeout fast inside an inner loop, timeout will often
return the same channel from more than one call to the function. So if you
call timeout every millisecond, you'll get the same channel about 5-10
times. This increases performance, and since the timeout logic involved
isn't highly accurate anyways this performance optimization rarely causes
very many problems.

If this is causing a problem in an actual system I'd love to hear about it.
Neither of these issues are caused by hard limits in the design of
core.async. So they could be tweaked, but we'll probably only do so if we
have a concrete example of a problem. So a use case would be needed,
instead of an arbitrary failing test case.

Timothy


On Fri, Mar 28, 2014 at 6:21 AM, Peter Taoussanis <ptaoussa...@gmail.com>wrote:

> Please, not at all! Appreciate any ideas :-)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"One of the main causes of the fall of the Roman Empire was that-lacking
zero-they had no way to indicate successful termination of their C
programs."
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to