Giter Site home page Giter Site logo

Comments (2)

alexreznikoff avatar alexreznikoff commented on June 21, 2024 1

Hello @artas728
Thank you, it works

from panini.

artas728 avatar artas728 commented on June 21, 2024

Hello @alexreznikoff
The problem is in the conflict related to sentry behavior (I have not worked with sentry before and do not know how it works). I ran your code without sentry and it works well. I would recommend trying to run sentry as a panini task:

from aiohttp import web
from panini import app as panini_app
import sentry_sdk
import settings

app = panini_app.App(
    service_name='nats-microservice-that-also-http',
    host='127.0.0.1',
    port=4222,
)
app.setup_web_server(port=5000)

@app.task()
def start_sentry():
    sentry_sdk.init(settings.SENTRY_SDK)

@app.listen("some.subject")
async def stream_listener(msg):
    print(f"event {msg.data} from {msg.subject} has been processed")


@app.http.get("/status")
async def web_endpoint_listener(request):
    return web.json_response({"status": "ok"})

if __name__ == "__main__":
    app.start()

Let me know if it works.

from panini.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.