-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Next iteration of pub/sub quickstarts (python, dotnet) #7
Next iteration of pub/sub quickstarts (python, dotnet) #7
Conversation
Signed-off-by: Paul Yuknewicz <[email protected]>
Signed-off-by: Paul Yuknewicz <[email protected]>
Signed-off-by: Paul Yuknewicz <[email protected]>
Signed-off-by: Paul Yuknewicz <[email protected]>
PubSub Subscribe was recently added to Flask Dapr: dapr/python-sdk#351. My suggestion is to publish this update and use it as it simplifies the amount of code developers need to write: from flask import Flask, request
from flask_dapr import DaprApp
app = Flask('myapp')
dapr_app = DaprApp(app)
@dapr_app.subscribe(pubsub='pubsub', topic='some_topic', route='/some_endpoint')
def my_event_handler():
# request.data contains pubsub event
pass |
Signed-off-by: Paul Yuknewicz <[email protected]>
Signed-off-by: Paul Yuknewicz <[email protected]>
Signed-off-by: Paul Yuknewicz <[email protected]>
Signed-off-by: Paul Yuknewicz <[email protected]>
Agreed. Nice! It's in. You just have to pip install the 1.5 sdk version but the requirements.txt now does this. |
Signed-off-by: Paul Yuknewicz <[email protected]>
We might have to change the variables and method names later on to keep it consistent across all the programming languages. I am currently working on the spec/template to be followed in the coding/design. We might make few changes according to it. Now the PR looks good to me :-) |
This addresses a few challenges with the current quickstart both around functionality and style:
Python
checkout
service is now the publisher, andorder-processor
is now the subscriber. this matches common examples, e.g. https://docs.microsoft.com/en-us/azure/architecture/example-scenario/data/ecommerce-order-processingorder = {"orderid": random.randint(1, 1000)}
app.py
pip install
dependencies, namelydapr
andFlask
Dotnet (C#)
checkout
andorder-processor