Comments (4)
No, they can be coroutines, as something in the framework or application could explicitly await
on them periodically to drive them forward. They are relatively likely to be tasks, but they do not strictly have to be, as far as I am aware.
from asgiref.
If they’re not a task, something has to await
them for them to run. As far as I can tell, the only tasks that the ASGI server promises to create are one for the lifespan protocol and one for each request. If any of those things is awaiting another coroutine, then that coroutine is living within the lifetime of that other task, and so cannot be killed by the ASGI server itself (because the ASGI server doesn’t even know it exists, it only runs when the task in question drives it).
What else is there that could await
them?
from asgiref.
You can, for example, use event_loop.call_later
in order to have something run at some future time without a Task.
from asgiref.
Ah, I guess you could call_later(the_coroutine.send)
or something like that (since call_later
itself doesn’t take a coroutine but just a normal function). I guess that makes sense, though I still find the wording a little bit confusing.
from asgiref.
Related Issues (20)
- asgiref's WsgiToAsgi wrapper does not handle "client": None per spec
- Parameters to Generic[...] must all be type variables HOT 2
- ApplicationCommunicator cancels the application future unnecessarily? HOT 3
- Communicating client disconnects without receiving the request body HOT 11
- Documentation suggestion - Cookie header handling for HTTP/2 HOT 2
- Is the server in charge of making sure the `Content-Length` matches the body? HOT 1
- Re-evaluate "http.response.zerocopysend" HOT 8
- About `scope[path]` and `scope[root_path]` HOT 11
- Add Type Annotations to `asgiref` Module HOT 1
- Add Type Annotations to `asgiref` Module Functions HOT 2
- Parameters to Generic[...] must all be type variables when use with sys.setprofile HOT 3
- Can asig http extensions be used in WebSocket Denial Response? HOT 2
- Using asyncio.shield hangs/deadlocks when used with sync middleware. HOT 10
- What am I allowed to do with the send/receive callables? HOT 1
- async_to_sync does not use the correct thread when used as decorator HOT 3
- Contradiction between general and HTTP-specific sections on handling of send on a closed connection HOT 2
- `PATH_INFO` set incorrectly by `WsgiToAsgiInstance.build_environ()` HOT 1
- Compatibility with gevent monkey-patching? HOT 1
- Failure in exception handling in current_thread_executor.py _WorkItem.run() 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 asgiref.