Fork me on GitHub
#core-async
<
2020-03-16
>
mpenet08:03:35

is there a decent way to differenciate a promise-chan from another type of chan? I think I can just tap into internals (look at channel.buf) but I am not sure that's something I'd like to do

yonatanel08:03:25

Why do you need that?

mpenet09:03:03

I am in a case where I can optimize the consumer side depending if it's a single value or N

mpenet09:03:19

and I know for certain single value will always from from a promise-chan

yonatanel09:03:10

As I understand it, you pass a promise-chan only when the consumer already expects to consume just once. May I ask what’s your case in more detail?

mpenet09:03:08

no not really. Think setting up http content-length early (upon sending headers) for single shot response vs chunked header for N messages). I could set chunked for all and be done with it. but it is problematic to do that for a few reasons and I'd rather avoid it.

mpenet09:03:40

sending headers and writing the actual body of the response are done separately (working with vertx http client in that case)

mpenet09:03:09

I think I might just make this stuff explicit I think instead of relying on shape of input