Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

GCES Subscriber Framework

  • listeners/collector/__init__.py
import logging
from gces import EventSubscriber


TOPIC_NAME = 'super_service_1.events'
SUBSCRIBER_NAME = 'collector'

def log_data(self, data):
   logger.info(data)

def subsetup_(config):
   es = EventSubscriber(TOPIC_NAME, SUBSCRIBER_NAME)
   es.register_fsub('LINK_ENABLE', log_data)
   es.register_fsub('LINK_DISABLE', log_data)

   config.register_subscriber(SUBSCRIBER_NAME, es)
  • listeners/spammer/__init__.py
import logging
from gces import EventSubscriber


TOPIC_NAME = 'super_service_2.events'
SUBSCRIBER_NAME = 'spammer'

def log_data(self, data):
   logger.info(data)

def subsetup_(config):
   es = EventSubscriber(TOPIC_NAME, SUBSCRIBER_NAME)
   es.register_fsub('SPAM_DETECTED', log_data)
   es.register_fsub('SPAM_REGISTERED', log_data)

   config.register_subscriber(SUBSCRIBER_NAME, es)
  • subscriber.py
import logging

logging.basicConfig()
logger = logging.getLogger()
logger.setLevel('INFO')

import signal, os
import importlib

from gces_subsfm import Configurator


def create_app():
    config = Configurator()
    config.include('listeners.collector')
    config.include('listeners.spammer')

    return config

app = application()

Run Subscriber

$ gces-subsfm -A subscriber:app

Metadata

Release files for gces-subsfm 0.0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gces-subsfm 0.0.1a0
File Size Uploaded Provenance
gces_subsfm-0.0.1a0.tar.gz 3.2 kB Without provenance Details

Release files / gces_subsfm-0.0.1a0.tar.gz

Download URL gces_subsfm-0.0.1a0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4c8954baaa297351c7dfd2d171e0fe08ac4b4c90a7b9542aaa700e1e392aace3
BLAKE2b-256 checksum
How to use checksums
f922f2c315472a4a54551a52aa1ece15c8c8f251df827398c881913e81d6d7d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

Security for gces-subsfm 0.0.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page