aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-evt.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-23afb-stub-ws: Safe handling of deconnectionsJose Bollo1-1/+1
This commit also include many comments and improvements in naming of functions. Bug-AGL: SPEC-1668 Change-Id: I1b5dd95678d94e9edfca1c598c5697e90bb9e5bf Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
2018-06-15api-v3: First draftJosé Bollo1-72/+75
This commit introduces the bindings v3 API for bindings. The documentation has still to be improved and will come very soon. Change-Id: I8f9007370e29f671fdfd1da87fff7372a17db7af Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-02-27Update date of copyright noticesJosé Bollo1-1/+1
Change-Id: If9d7e7728df086fbb7214f1de5cbec35cd2f1d9b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2018-01-31afb-evt: Add event creation with prefixJosé Bollo1-0/+29
Change-Id: I2fd35e8ed59c28f4283be698a2586cdae5f7c8cf Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Add function afb_evt_eventid_addrefJosé Bollo1-0/+9
Change-Id: I737f3ceaa41b5ec9a200a615dbc29965ed11c17c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Improve naming of evt_eventidsJosé Bollo1-19/+19
Change-Id: I1fa3cf776110f67ad1b18c4c83f3a1707692ae8b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Deprecate internal use of afb_eventJosé Bollo1-22/+34
The deprecation is made in favor of afb_eventid but this can change later in favor of afb_evt_evtid. Change-Id: Ic16cb25dbd97cb1e8d26b3c54b159d46bbf82671 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Introduce afb_eventidJosé Bollo1-12/+13
This new name is better suited because it is not an event but the id of an event. This also prepares the new api with pointers. Change-Id: I7be88bb36cf72bf7df70793a77452e405130b951 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09Make afb_event_drop obsoleteJosé Bollo1-18/+6
The function is now replaced by the function afb_event_unref. In the same time, the function afb_event_addref is made available. Change-Id: I9aa30e80e64e82f3b16ab359982337771b287185 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-10-09afb-evt: prepare futur afb_eventidJosé Bollo1-155/+325
Change-Id: Ie4668c2dadbdfbe79bac2c27a1b188edecbcf847 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-08-08afb-evt: fix a bug discovered by clang-checkJosé Bollo1-9/+5
Change-Id: I6bb1dffeb17fdcaf6e3a2686651d35dd0b0500b9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-07-31afb-evt: add internal push functionsJosé Bollo1-3/+30
For the implementation of monitoring, the event should be pushed without hooking internal. Change-Id: I4372bbc55e78c851db660a69bb2e60995fbdc88f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-07-31afb-evt: unprefix event nameJosé Bollo1-1/+3
Removes the api prefix of the event name. Change-Id: I050dc86beb08659751c1e57b8d3ea233bac9e411 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-06-01Add hooking for eventsJosé Bollo1-15/+60
Change-Id: If5fe736e04c9f4298302c3cbba568f1d6346ee67 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-05-18Fix a bug in subscribers countingJosé Bollo1-3/+4
To avoid as much as possible allocation/deallocation when possible sequences of subscribe/unsubscribe are encountered, the watch strucutre of events is destroyed only when either the event or the client is destroyed. This commit fixes a bad handling in the count of active subscribers. Change-Id: I3f240e69c3b21356ff07f584fe9bfb578d46732b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-11Fix uninitialized variableJosé Bollo1-0/+1
Change-Id: Ia8a7a1471f004933a48797b91c01fd8b53465de0 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-04-10Make implementation multithreadJosé Bollo1-35/+89
This changes makes many improvement needed for multi-threading: - json object can't be shared across threads because get/set is not protected - event are now multithread compatible Change-Id: Id44b12c68e0fa67042b8ea44939af4edfa76270a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2017-01-03Adds 2017 to copyrightsJosé Bollo1-1/+1
Change-Id: Id85c4eb4e36a05b61346004ba95daa19faf5074f Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-10-14event: add ability to get the event nameJosé Bollo1-3/+13
Change-Id: Iecfeb4ab07c07715093d729710669abecee722de Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-23evt: handles broadcasting and trackingJosé Bollo1-30/+115
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-17evt: exposes name of eventsJosé Bollo1-0/+8
Change-Id: I1976848be0e8aeb170da37e1254208035e0e741a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-17evt: improves commentsJosé Bollo1-4/+88
Change-Id: I6c3e855030af9064335028e51d10c41db85a3f3c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-17evt: minor cleanupJosé Bollo1-5/+0
Change-Id: Ice4620cabc5a8643551439a149e80df255438020 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
2016-06-09Events: refactoringJosé Bollo1-0/+261
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>