Google Cloud Event System.
Project description
GCES - Google Cloud Event System
Goals
This project aims make it easier to have a global Event Publisher/Event Subscriber system to be used accross services.
Architecture
Quick Event Notification Example
from gces import EventPublisher
ept = EventPublisher('gces')
ept.notify('SIGNUP_EVENT', {'user_id': 1234})
ept.notify('LOGIN_EVENT', {'user_id': 4321})
Quick Event Subscription Example
import time
from gces import (
EventSubscriber
)
def example_run_subscriber_function(data):
print("Data Received: {}".format(data))
TOPIC_NAME = 'gces'
SUBSCRIBER_NAME = 'gces_example'
es = EventSubscriber(TOPIC_NAME, SUBSCRIBER_NAME)
es.register_fsub('EXAMPLE_RUN_FUNCTION_PROCCESS' example_run_subscriber_function)
es.start()
if __name__ == '__main__':
try:
while True:
time.sleep(200)
except KeyboardInterrupt:
print('Bye!!!!')
Google Cloud Credentials
- Create Credentials at Google
- export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/<credentials_file>.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gces-0.0.8a0.tar.gz
(5.3 kB
view details)
File details
Details for the file gces-0.0.8a0.tar.gz
.
File metadata
- Download URL: gces-0.0.8a0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e108e3b3c40b972383407773d2766120b2bb4fa0a36aafbbc9ff9be11c2b5c |
|
MD5 | a3a60f2b9cda264d91fb2f3548da41c1 |
|
BLAKE2b-256 | 39940afd954157acf3f203c5f70f1cab50cd3737b996ccda7e3ad0860adbcd81 |