Skip to main content

All Questions

Tagged with
0 votes
0 answers
53 views

In discord.py, flask-socketio, and flask, how do I send a file to the server from a listening socket?

I already tried using various methods with async functions and scheduling tasks, and event loops. I don't know what to do. The code below is the socket that recieves the uploaded file and posts it to ...
Skyrocketer's user avatar
0 votes
0 answers
28 views

Unable to implement webhook with flask-smorest using async

I am trying to implement a simple mock api that implements webhooks using flask-smorest. Basically, I am trying to mimic an api that process a video and sends a post response of succesful/error once ...
Mariana Ramirez Duque's user avatar
1 vote
0 answers
170 views

flask return async generator in async endpoint

Flask allows streaming content using generators. But, I can't stream content using an async generator in an async endpoint. Here's an example: from flask import Flask, Response import asyncio app = ...
Ashkan Arabi's user avatar
0 votes
0 answers
148 views

Stream response in Flask with AsyncGenerator

I would need to stream data to the user via an endpoint through a function that returns an AsyncGenerator The idea is as follows: message_route = Blueprint('message_route', __name__, template_folder='...
Lorenzo Vaccher's user avatar
0 votes
0 answers
27 views

python asyncio.run inside reused method [duplicate]

In Python, whenever I see examples asyncio.run() usage it is inside a main function. I have this scenario in my Flask application: A request goes through: MyController → MyService → MyRepository I ...
javaTry's user avatar
  • 1,333
0 votes
0 answers
143 views

got Future <Future pending> attached to a different loop : error while running code

I am trying to build a service which runs on a flask server that creates a schedule and runs it continuously to poll data and check results. I'm using apscheduler and AsyncIOS for this. The issue is ...
Rashi Bandi's user avatar
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 ...
Miskler's user avatar
0 votes
0 answers
36 views

Websocket stuck in CONNECTING readyState until ERR_CONNECTION_ABORTED error

I have a simple python Flask backend using Asyncio: # Simplified version of backend connectedClients = {} async def handler(webSocket): async for messageString in webSocket: print(f'...
Andrew's user avatar
  • 1,998
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 = ...
vbulash's user avatar
  • 351
0 votes
0 answers
94 views

How can I pass a parameter to Async function in Python

So I am using Python Flask (ik, not optimal, but it is what I know.) However, I am getting an error that I understand, but I am not familiar enough with async to be able to solve it myself. I lack ...
AcastaTeacup's user avatar
1 vote
1 answer
393 views

run an async websocket loop in background of flask app

I am trying to build an app which will connect to a websocket (for streaming data) and provide this data with rest API. I am using Flask for creating my API and websockets package for connecting to ...
Rishabh Gupta's user avatar
-1 votes
1 answer
72 views

frontend not displaying data emitted from socketio in real-time

my websockets app sends data fom the backend to the frontend. but it only updates whenever i refesh the page ,not real-time . I want the updating to be real time my websockets app sends data fom the ...
Okech Okon's user avatar
3 votes
2 answers
968 views

"Event loop is closed" in Flask/LangChain/asyncio app

Context. I want to run a few LLM requests in parallel. I'm using Flask, LangChain, and asyncio. Flask is installed with the "async" extra. Problem. Every second (!) time the app handles a ...
RudolfKaiser's user avatar
0 votes
0 answers
116 views

Flask with firebase_admin async firestore client runtime error: Event loop is closed

When running a Flask application in combination with an async firestore client, a runtime error 'Event loop is closed' appears the second time loading the page. Example app: import firebase_admin from ...
lennertcl's user avatar
0 votes
1 answer
87 views

How to launch / terminate periodic task running on the background using python asyncio in Flask Backend App?

I have a python flask backend app. I want to create a mechanism that can let some jobs run periodic on the background, like auto-update something every 1 minute. But I have been blocked by some errors ...
stevezkw's user avatar
  • 2,693

15 30 50 per page
1
2 3 4 5
7