Events: refactoring 29/5929/1
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 9 Jun 2016 05:54:31 +0000 (07:54 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 9 Jun 2016 06:39:02 +0000 (08:39 +0200)
commit7e0abe76db7b90369429bf387d7aad0fb5a42328
treeeedf5609a588f0d9d743fb941bc8727ff1356b21
parentc37c8e6291c36665dd23601a8ce1449afd43e6df
Events: refactoring

This new version allows to subscribe a client for
an event.

The event should first be created for the API
(the API's prefix is added) using 'afb_daemon_make_event'.

After that, plugins can subscribe or unsubscribe their
clients (identified through requests) to the events that
it generates. See 'afb_req_subscribe' and 'afb_req_unsubscribe'.

Events created by 'afb_daemon_make_event' can be widely
broadcasted using 'afb_event_broadcast' or pushed only to
suscribers using 'afb_event_push'.

Events can be destroyed using 'afb_event_drop'.

Change-Id: I7c0bed5e625c2052dcd81c6bfe960def1fa032f3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
16 files changed:
include/afb/afb-event-itf.h [new file with mode: 0644]
include/afb/afb-plugin.h
include/afb/afb-req-itf.h
src/CMakeLists.txt
src/afb-api-dbus.c
src/afb-api-dbus.h
src/afb-api-so.c
src/afb-context.c
src/afb-evt.c [new file with mode: 0644]
src/afb-evt.h [new file with mode: 0644]
src/afb-hreq.c
src/afb-hreq.h
src/afb-ws-json1.c
src/afb-ws-json1.h
src/session.c
src/session.h