channels icon indicating copy to clipboard operation
channels copied to clipboard

AsyncHttpConsumer: Do not stop the consumer when exiting `self.handle` already

Open matthiask opened this issue 6 years ago • 1 comments

Earlier self.handle always disconnected the HTTP client and stopped the consumer when exiting. This meant that the consumer couldn't receive any messages from the channel layer at all, making it impossible to send e.g. messages from workers to connected HTTP clients via long polling or server-sent events.

matthiask avatar Aug 11 '19 15:08 matthiask

There were reasons (tm) for the addition of the StopConsumer and self.disconnect lines, but I'm not sure I understand them after rereading the pulls. Maybe now we're back to the situation where a dying consumer does not disconnect the HTTP connection?

Also, it's a bit unexpected that tests pass. I mean it's nice obviously, but I also suspect that coverage is ... not very good in this particular area.

matthiask avatar Aug 11 '19 15:08 matthiask