我有一个 Flask 应用程序,在尝试将 Flask 与faust集成时出现此错误。
应用程序.py
import mode.loop.eventlet
import logging
import logging.config
import json
from flask import Flask
from elasticapm.contrib.flask import ElasticAPM
def create_app():
app = Flask(__name__)
configure_apm(app)
configure_logging()
register_blueprints(app)
register_commands(app)
return app
Run Code Online (Sandbox Code Playgroud)
主要.py
from flask import jsonify
from litmus.app import create_app
from intercepter import Intercepter
app = create_app()
app.wsgi_app = Intercepter(app.wsgi_app , app)
@app.route('/status')
def status():
return jsonify({'status': 'online'}), 200
Run Code Online (Sandbox Code Playgroud)
另一个控制器
@api_blue_print.route('/v1/analyse', methods=['POST'])
def analyse():
analyse_with_historic_data.send(value=[somedata])
return jsonify({'message': 'Enqueued'}), 201
Run Code Online (Sandbox Code Playgroud)
analysis_with_historic_data.py
@app.agent(analysis_topic)
async def analyse_with_historic_data(self, stream):
async for …
Run Code Online (Sandbox Code Playgroud)