All Questions
22 questions
0
votes
0
answers
31
views
Using Flask request in Async Functions Across Modules
I'm working on an async Flask application and have a custom object that initializes with request data. Here is a simplified version of my code:
In my route handler:
@app.route('/')
async def ...
1
vote
1
answer
148
views
Flask: how to return validation before full route code execution
Sorry for newbie question - I am new in Python.
I have to return validation result of Flask route parameter before main code execution:
@app.route('/', methods=['POST'])
def index():
validation = ...
0
votes
0
answers
41
views
How to create an HTTP view take takes longer than Heroku's timeout to process?
So, I have a code like this, which is a simple timer with an interval inside it:
Timer:
async def timer_function(target_time_obj, remaining_timers, timer_ended_flag):
target_time = dt.datetime....
1
vote
0
answers
134
views
Non awaited task seems to be awaited on. Python Quart
Code below for reference
import asyncio
from models import database
from quart import Quart, request, abort, jsonify
app = Quart(__name__)
async def process_input(*args) -> None:
""&...
0
votes
0
answers
137
views
Async IO for waiting on POST payload (endpoint to be hit before accessing class members) in Python Flask
I have two python files ,
factor_main.py
import app
from app import *
class Webhookhandler:
def __init__(self):
self.app = app
self.item = {}
@staticmethod
def localize(...
0
votes
0
answers
318
views
Python-asyncio and subprocess deployment on IIS: returning HTTP response without running another script completely
I'm facing an issue in creating Realtime status update for merging new datasets with old one and machine learning model creation results via Web framework. The tasks are simple in following steps.
An ...
0
votes
1
answer
937
views
Flask upload to s3 using asyncio
I am trying to upload a file to s3 using boto3 and the upload instruction falls inside of Flask route
is there a way to keep the s3 file from uploading and have the function return the json without ...
2
votes
1
answer
2k
views
Error Running Async Flask 2.0.0 on Python 3.6.10
I am attempting to run Flask in an async manner on python 3.6.10, but keep getting:
RuntimeError: Async cannot be used with this combination of Python and Greenlet versions.
I have written the ...
0
votes
1
answer
93
views
Why does the add_roles() method from discord.py fail here?
The following method is called on a discord bot thread from a flask application. All the print checks display the correct data so the method is being run successfully, however the final fstring
f'{...
0
votes
2
answers
219
views
ERROR:root:Error in xyz There is no current event loop in thread 'Thread-7'
I am trying to achieve fire_and_forget functionality and here are the details.
Async decorater i am trying to use:
import asyncio
import time
def fire_and_forget(f):
def wrapped(*args, **kwargs):
...
1
vote
1
answer
635
views
How can I serve stored data from web-sockets using Flask?
TLDR; I am trying to run a client that fetches data from a web-sockets URI, and then use Flask to serve the fetched data from the sockets.
My intended workflow looks like: Read data from web-sockets ...
0
votes
1
answer
436
views
In a flask application how can you introduce asynchronicity?
In my flask application there are some REST end points which takes too much time to respond. When invoked, it mostly carries out some CRUD operations in database, some of which could be made ...
1
vote
2
answers
2k
views
asyncio application with flask or aiohttp server inside
I've revamped my last year's app. In the beginning there were two different python applications - first one for counting statistics and the second one - web server gunicorn+flask with GET requests. (...
2
votes
1
answer
3k
views
Python3 Flask asyncio subprocess in route hangs
I'm using Flask 1.0.2 with Python 3.6 on Ubuntu 18.04. My app should use asyncio and asyncio.create_subprocess_exec() to lauch a background script, read stdout from it, and then return status when the ...
3
votes
1
answer
2k
views
Asyncio function works when called from script but not from Flask route
I'm a novice with Python and these libraries/modules. I'm writing a simple ping-test network scanner as a learning project.
I first developed a script using asyncio to ping addresses on a network
#...