An event
is something that has happened. In the past.
Event should be in the form of: <service>.<resourceType>.<verb_past_tense>
Examples:
-
iam.user.created
-
billing.invoice.drafted
-
billing.invoice.paid
(function) create a new event (event_id), insert it (table lib_event.event) and trigger a pg_notify("lib_event.created", event_id)
lib_events.create("iam.user.created", payload jsonb, ...)
pg_notify limits payload to 8000 bytes so lib_event only contains the event_id that can then be retrieved with
select * from lib_events.events where event__id = XXXX
(view) public access to one or more events
select event__id, headers, payload from lib_events.events;