Event notifier with many subscribers support
Project description
event-notifier
Simple python notifier.
Contents
Background
This is the
Installation
pip install event-notifier
Usage
import Notifier
TBD
Example taken from the internet showing how to mark it down inside .md file:
The emit()
function takes three arguments:
- an
event
which is a valid CloudEvent, - a
path
which is the path associated to the function (default:/
) - a
headers
object that represents the headers sent to the gateway (default:{"Content-type": "application/json"}
)
The function returns a request object. If your event has a sync
subscription attached, the fetch
response will have the status code and body from the subscription. If not, the response will return a 202 Accepted
status code with an empty body.
Constructor
addEventSubscriber(eventName, subscriber)
Parameters
url
-string
- optional, Events API URL, default:http://localhost:4000
space
-string
- optional, space name, default:default
configurationUrl
-string
- optional, Configuration API URL. By default, it's the same asurl
but with4001
portconnectorUrl
-string
- optional, Connector API URL. By default, it's the same asurl
but with4002
portaccessKey
-string
- optional, access key for hosted Event Gateway. Access key is required for using Configuration API methods on hosted Event Gateway
Example
import Notifier
notifier = Notifier(["onCreate", "onOpen", "onModify", "onDelete"])
Available Functions
addEventSubscriber(eventName, subscriber)
some Function Name here
TBD
Example
#TBD
some other Function Name here
Utility to print the current configuration.
Example
#TBD
Tests
PyTest is used for tests. Python 2 is not supported.
Install PyTest
$ pip install pytest
Run tests
$ py.test test/*
License
License Copyright (C) 2020 Vitalij Gotovskij
event-notifier binaries and source code can be used according to the MIT License
Contribute
TBD
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
Built Distribution
Hashes for event_notifier-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7732b627ba110ceb4ba444031fd4d34fb0ebd090d1b7d463fdf1d1142d42725 |
|
MD5 | cad24f6f5b224e8fc06bccb203831e53 |
|
BLAKE2b-256 | 226a8fdf880e369791edb6d51a7304d28f5a6d3be49a6d12202d418df78279b8 |