Library to be a Client and Server using event protocol
Project description
events-protocol
Como usar
Client
As informações essenciais para enviar o evento são: url, name, version e payload.
Apenas com estas informações já é possivel enviar um evento.
from events_protocol.client import EventClient
# Instancia o client
client = EventClient(url="http://example.com/events/")
# Exemplo passando apenas as informações essenciais
response = client.send_event(
name="event:example",
version=1,
payload={
"example": "example"
},
)
# Exemplo passando todas as informações
response = client.send_event(
name="event:example",
version=1,
id="9230c47c-3bcf-11ea-b77f-2e728ce88125",
flow_id="a47830ca-3bcf-11ea-a232-2e728ce88125",
payload={
"example": "example"
},
identity={
"userId": "USER_ID",
},
metadata={
"date": "00-00-0000",
},
timeout=1000,
)
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
events-protocol-0.0.1.tar.gz
(11.6 kB
view hashes)
Built Distribution
Close
Hashes for events_protocol-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a90c5c03387a287dc4347294dfd9a9777ce5a1b0cd3c5ac96358abe0443dbab |
|
MD5 | 61fa0fac2e279771e5b7791e3615f407 |
|
BLAKE2b-256 | 9f6cfafc90a8da6a02b0661b8a65ce010fa15a0e32c7481e33a75cdf1d79dd8d |