Comments (2)
Hello @artas728
Thank you, it works
from panini.
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)
- Add arg "start_in" for a task and an interval task HOT 1
- If adding a middleware in tests (ErrorMiddleware for ex.) - diff datatypes tests failing HOT 1
- ValueError: Expected object or value - ujson does not support NaN
- Type for 'async def subscribe_new_subject()' throw the warning HOT 1
- DebugMiddleware feature
- README.md for utils not correct HOT 1
- Middlewares do not allow to use sync functions HOT 1
- Add possibility not to use asyncio.iscoroutinefunction in middlewares, but still support sync def HOT 1
- If nats doen't answer - the panini becomes idle HOT 1
- Async Event Loop
- How to catch Validator error HOT 7
- Exception DataTypeError happens but not catch HOT 2
- Custom Logger without files on a file system HOT 2
- DataTypeError raised when listener's return type is not JSON HOT 6
- TestClient.request() method does not have a data_type argument like the real client HOT 3
- Website returning 502 Bad Gateway HOT 1
- listener app never receives request respone HOT 8
- AttributeError: 'NATSClient' object has no attribute '_js' HOT 1
- Move to nats-py 2.6.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panini.