Fork me on GitHub
#core-async
<
2018-10-08
>
tianshu09:10:35

is (doto (a/chan) (a/close!)) the correct way to create a port that drops every input?

benzap09:10:09

I believe that would close the channel, and make it inoperable

benzap09:10:26

you need some sort of buffer that drops values

benzap09:10:21

(chan (sliding-buffer 1)) is probably what you want

ghadi13:10:44

you can also use an ordinary channel, with or without a buffer and launch a go block that sinks the value before handing back the channel to the producer

noisesmith16:10:58

If the client never checks the return value of a put, a closed chan acts like a chan that drops ever input. IIRC even a promise-chan would actually (it would set itself from the first value, and consume and ignore the rest).

noisesmith16:10:22

a dev-null-chan seems like a potentially useful feature though

markmarkmark16:10:24

I went ahead and made a dev null buffer 😛

😄 24
markmarkmark16:10:07

it never blocks, takes always get nil, and puts always return true

mattly20:10:49

it's Universe Scale!