Skip to main content

Google Cloud Event System.

Project description

Build Status PyPI PyPI Coverage Status

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

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


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.3a0.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file gces-0.0.3a0.tar.gz.

File metadata

  • Download URL: gces-0.0.3a0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for gces-0.0.3a0.tar.gz
Algorithm Hash digest
SHA256 c963389936e6f023a89e4fdd2e7cf3b06b736e062ebd76b3f79a37aaa565767d
MD5 09503bfb133205a962ee3241e42b5bd5
BLAKE2b-256 77979a37fbf93eb86658da454928aaf53f898f2a6fe6ead09c8ada53a91b59f7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page