Implement HTTP generic consumers
See original GitHub issueThe HTTP event spec in ASGI is a little complex, and it would be nice to have an Async-capable generic consumer for HTTP to allow easier writing of long-poll applications. Something like:
class LongPoller(AsyncHttpConsumer):
async def request(self, body):
await asyncio.sleep(10)
await self.send_response(200, "foo")
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Consumers — Channels 4.0.0 documentation
Much like Django's generic views, Channels ships with generic consumers that wrap common functionality up so you don't need to rewrite it, specifically...
Read more >c# - Generic .Net Producer/Consumer - Stack Overflow
Use generics for the produced and consumed types (input, queued task, and output types, or any combination thereof); Allow you specify how many...
Read more >How to use Java's functional Consumer interface example
Implement a Consumer with a Java class. Here is the Java Consumer function implemented using a Java class instead of a lambda expression:...
Read more >Generic Customer API
Purpose: Use the generic customer API to add or change customers based on XML ... format: http://server:port/SerenadeSeam/sxrs/SerenadeREST/CWCustomerIn, ...
Read more >generic-message-consumer/IMessageHandler.java at master
Copyright 2018 Karlsruhe Institute of Technology. *. * Licensed under the Apache License, Version 2.0 (the "License");. * you may not use this...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe we even have tests that check that
more_body
support works in Channels, it’s just not implemented in the server yet. But we want it to work once it is.@hishnash Yes. The implementation was not my idea, similar code exists in
channels/http.py
already: https://github.com/django/channels/blob/6afd423/channels/http.py#L180