Asynchronous event dispatching to allow Flask to respond immediately
See original GitHub issueDescription
As per the Events API documentation, we should send a valid response in 3 seconds, when using this API I found it quite difficult to figure out how to achieve this when I tried to implement something which lasted longer than 3 seconds.
We are still trying to get it working in our bot, but it got somewhat messy and I feel like that it would be much nicer if it were in this library rather than having to make our own.
The way I’d see this being implemented is that the event emitter would run each handler in a background process by default (or maybe a way to opt-in to this behaviour?). I understand this might cause issues for bots which are already dependent on the current behaviour of the API though, but I would be curious to know your thoughts about whether this is something you’d like to include in some form.
What type of issue is this? (place an x
in one of the [ ]
)
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements
- I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
- I’ve read and agree to the Code of Conduct.
- I’ve searched for any related issues and avoided creating a duplicate issue.
Issue Analytics
- State:
- Created 6 years ago
- Comments:37 (20 by maintainers)
As of now, there’s no active development on this issue. We’ve been thinking about doing some sample code to try and show developers how they might do asynchronous event dispatch in their application.
It would be useful to know if this interests you (please 👍 this comment). Also, there are many reactive frameworks we could use, but we can’t build a sample for all of them (examples mentioned above are
gevent
,responder
,python-rq
,twisted
, etc). It would be really helpful to let us know if there are one or many of those that you are interested in.We got another Python dev on the team (Welcome, @RodneyU215 🎉), so we should be picking this back up soon.
Thanks a ton for all of your input, guys. it’s been super helpful!