Fork me on GitHub
#core-async
<
2016-06-15
>
hiredman02:06:40

When you hit the limit on queued puts you can look outside core.async for something to act as an unbounded buffer, like a list, but that is treating a symptom

hiredman02:06:01

Hitting the queued puts limit means you are queueing items faster than you can process them, and an unbounded buffer isn't going to solve that

hiredman02:06:05

You may want to look at a sliding buffer or a dropping buffer, which are different policies for handling producing faster than you can consume

hiredman02:06:13

A lot of JavaScript callback APIs are problematic in that they don't have a good way to communicate back pressure to slow a producer down for a consumer

hiredman03:06:47

I would look at using two channels, one to send lines to be processed down, and one to ack lines as processed

hiredman03:06:21

The callback for each line should put! The line on the line channel then read from the ack channel. Maybe that would be take! I don't remember.

hiredman03:06:53

Blegh, it doesn't actually look like take! Would do it, so there just may not be a way to do the feedback think

donaldball12:06:20

Has anyone written a core.async channel that closed at a certain time, rather than after a duration of time has elapsed?

Alex Miller (Clojure team)17:06:41

Would be easy to do with existing Java stuff

ghadi18:06:47

making a timeout channel of the delta not sufficient?

donaldball19:06:01

If the jvm is paused for an amount of time (e.g. laptop turned off, but other scenarios seem plausible) the timeout doesn’t count the paused time

danielcompton22:06:39

@donaldball: does GC affect it too?

donaldball22:06:40

Do you mean JVM pauses for GC? Frankly I’m not sure.

donaldball22:06:21

AFAICT the java.util.concurrent classes only provide guarantees on the minimum amount of time things will delay

donaldball22:06:00

I’m not actually sure the best way to accomplish my goal with the j.u.c stuff, tbqh. Seems like my best bet might be to start a ScheduledThreadPoolExecutor running e.g. every minute, have it check the system time, and send any necessary signals