1 # Trigger notification exemple
4 This exemple is made-up of three executables.
6 ### `notification-client`
9 Usage: notification-client TRIGGER_NAME
12 A simple client that subscribes to the notifications emitted by the `TRIGGER_NAME` trigger.
14 ### `instrumented-app`
16 An application that emits the `trigger_exemple:my_event` event every 2 seconds.
20 This script adds a trigger named `demo_trigger` which emits a notification when the user-space `trigger_exemple:my_event` event occurs.
22 Once the trigger has been setup, the notification-client is launched to print all notifications emitted by the `demo_trigger` trigger.
26 Simply run the included Makefile.
28 ## Running the exemple
30 1) Launch a session daemon using:
34 2) Launch the `demo.sh` script
35 3) Launch the `instrumented-app`
37 The following output should be produced:
41 Registering a notification trigger named "demo_trigger" for the trigger_exemple:my_event user-space event
42 Trigger registered successfully.
43 Subscribed to notifications of trigger "demo_trigger"
44 [02-14-2020] 18:13:34.779766 - Received notification of event rule trigger "demo_trigger"
45 [02-14-2020] 18:13:36.779888 - Received notification of event rule trigger "demo_trigger"
46 [02-14-2020] 18:13:38.780514 - Received notification of event rule trigger "demo_trigger"
47 [02-14-2020] 18:13:40.780656 - Received notification of event rule trigger "demo_trigger"
52 [02-14-2020] 18:13:34.779433 - Tracing event "trigger_exemple:my_event"
53 [02-14-2020] 18:13:36.779693 - Tracing event "trigger_exemple:my_event"
54 [02-14-2020] 18:13:38.780010 - Tracing event "trigger_exemple:my_event"
55 [02-14-2020] 18:13:40.780286 - Tracing event "trigger_exemple:my_event"