Skip to content

Commit 9855121

Browse files
appengine: add low latency publish comment (GoogleCloudPlatform#2265)
* appengine: add low latency publish comment * nit: remove spaces
1 parent 63c677f commit 9855121

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • appengine/standard_python37/pubsub

appengine/standard_python37/pubsub/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def index():
4848

4949
data = request.form.get('payload', 'Example payload').encode('utf-8')
5050

51+
# Consider initializing the publisher client outside this function
52+
# for better latency performance.
5153
publisher = pubsub_v1.PublisherClient()
5254
topic_path = publisher.topic_path(app.config['GCLOUD_PROJECT'],
5355
app.config['PUBSUB_TOPIC'])

0 commit comments

Comments
 (0)