Comments (7)
Edit with more info
from daphne.
Async support for StreamingHTTPResponse is being added in Django 4.2.
from daphne.
Async support for StreamingHTTPResponse is being added in Django 4.2.
Hi, tnx for the quick response, Django 4.2 version by the docs is UNDER DEVELOPMENT and I looking for a solution for right now.
from daphne.
Then you'd need to patch The response object (and asgi handler) in Django.
If you find the commit in Django you can get the patch you need.
from daphne.
I'm actually not familiar with how to do it actually, u have some suggestions on how I can do it in my code?
from daphne.
Or maybe you have some idea which library I can use in Django if want to create a socket, in the end, my goal is to "listen" for only one variable.
the consumer that In my code for now it's just for the example.
from daphne.
You have to make the whole code async so test with a initial for loop and yield function and slowly start adding more code to it. And split it into more functions and use await with run_in_executor to make the sync code kind of like a async function.
And cap has to be used like
with concurrent.futures.ThreadPoolExecutor():
while cap.isOpened():
success, frame = await asyncio.to_thread(cap.read)
else you will get the async_generator error.
from daphne.
Related Issues (20)
- Can daphne run WSGI apps? HOT 6
- Does daphne have a file for initialization?
- Requests with Transfer-Encoding: chunked have no content HOT 15
- StreamHttpResponse with sync operations break in Daphne HOT 5
- Memory usage: Daphne loading all the file in memory (POST request) HOT 7
- Text streaming buffered issue
- Implement WebSocket Denial Response extension HOT 8
- [feature request] trailing headers HOT 1
- Add support for Python 3.12
- DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 HOT 1
- Daphne with self signed ssl HOT 2
- Daphne allows invalid characters within header names HOT 7
- Unix File Socket Argument HOT 12
- TypeError: object HttpResponse can't be used in 'await' expression HOT 3
- add support for --proxy-headers and friends in runserver HOT 4
- fd_endpoint.py is not properly installed HOT 7
- python manage.py runserver not working HOT 5
- Daphne - Twisted custom cipher list using set_cipher method HOT 3
- --noasgi won't serve static files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daphne.