core-async

mpenet 2020-03-16T08:55:35.257400Z

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

2020-03-16T08:59:25.258Z

Why do you need that?

mpenet 2020-03-16T09:00:03.258400Z

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

mpenet 2020-03-16T09:00:19.258600Z

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

2020-03-16T09:21:10.258800Z

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?

mpenet 2020-03-16T09:48:08.259Z

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.

mpenet 2020-03-16T09:48:40.259200Z

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

mpenet 2020-03-16T09:49:09.259400Z

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