8000 docs: re-init an env var in the third terminal (#128) · jrmfg/functions-framework-python@9ceb1e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9ceb1e0

Browse files
docs: re-init an env var in the third terminal (GoogleCloudPlatform#128)
- To make sure that the commands can be run if copied and pasted, need to reinitialize an environment variable in the third terminal. - Add command to install `google-cloud-python` Confirmed that it works when copied and pasted!
1 parent 0765875 commit 9ceb1e0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ response instead.
142142
functions-framework --target=hello --debug --port=8080
143143
```
144144

145-
1. Start the Pub/Sub emulator on port 8085.
145+
1. In a second terminal, start the Pub/Sub emulator on port 8085.
146146

147147
```sh
148148
export PUBSUB_PROJECT_ID=my-project
@@ -157,15 +157,17 @@ response instead.
157157
[pubsub] INFO: Server started, listening on 8085
158158
```
159159

160-
1. Create a Pub/Sub topic and attach a push subscription to the topic, using `http://localhost:8085` as its push endpoint. [Publish](https://cloud.google.com/pubsub/docs/quickstart-client-libraries#publish_messages) some messages to the topic. Observe your function getting triggered by the Pub/Sub messages.
160+
1. In a third terminal, create a Pub/Sub topic and attach a push subscription to the topic, using `http://localhost:8085` as its push endpoint. [Publish](https://cloud.google.com/pubsub/docs/quickstart-client-libraries#publish_messages) some messages to the topic. Observe your function getting triggered by the Pub/Sub messages.
161161

162162
```sh
163+
export PUBSUB_PROJECT_ID=my-project
163164
export TOPIC_ID=my-topic
164165
export PUSH_SUBSCRIPTION_ID=my-subscription
165166
$(gcloud beta emulators pubsub env-init)
166167

167168
git clone https://github.com/googleapis/python-pubsub.git
168169
cd python-pubsub/samples/snippets/
170+
pip install -r requirements.txt
169171

170172
python publisher.py $PUBSUB_PROJECT_ID create $TOPIC_ID
171173
python subscriber.py $PUBSUB_PROJECT_ID create-push $TOPIC_ID $PUSH_SUBSCRIPTION_ID http://localhost:8085

0 commit comments

Comments
 (0)
0