Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
roticagas authored Jan 4, 2019
1 parent a0053e1 commit 5b0b59f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ Python Boilerplate for Google Cloud PubSub running task in python
3. set ENV

- GOOGLE_APPLICATION_CREDENTIALS=services.json
- CLOUD_PROJECT=your-project
- CLOUD_PUBSUB_SUBSCRIBE_TOPIC=subscribe's topic
- CLOUD_PUBSUB_SUBSCRIBE_SUBSCRIPTION=subscription of subscribe's topic
- CLOUD_PUBSUB_PUBLISH_TOPIC=publish's topic

4. install requirements

- pip3 install -r /requirements.txt
4. add in requirements.txt
- -e git+https://github.com/roticagas/PubSubRunner.git#egg=PubSubRunner

## Test
*TBD using pycharm*
Expand Down Expand Up @@ -88,7 +91,7 @@ add messenger_main.py with this code
os.environ['CLOUD_PUBSUB_ACK_DEADLINE'] = '30' # play with this value


def job():
def job(): # this function is run after subscribe topic for easier testing.
config = RunnerConfig()
CloudUtil.publish_data(config.cloud_project, config.cloud_pubsub_subscribe_topic, json.dumps({'delay': '1'}))
CloudUtil.publish_data(config.cloud_project, config.cloud_pubsub_subscribe_topic, json.dumps({'delay': '15'}))
Expand All @@ -105,4 +108,4 @@ run
or

python3 messenger_main.py
python3 messenger_main.py

0 comments on commit 5b0b59f

Please sign in to comment.