diff --git a/documentation/eventlist.txt b/documentation/eventlist.txt new file mode 100644 index 0000000000000000000000000000000000000000..7eb80ee04d7ad39b9968390841d14b060d38e7ae --- /dev/null +++ b/documentation/eventlist.txt @@ -0,0 +1,23 @@ +Event Lists +=========== + +Event lists let the user or the system, create named events and users to +register for notification when the events are invoked. This is provided by +the eventman interface: + +1. Creating an event: +===================== +event_manager->create_event("event_a"); + +2. Registering and Deregistering Handlers: +========================================== +int h1 = event_manager->register_event("event_a", [&] { handler1(); }); +int h2 = event_manager->register_event("event_a", [&] { handler2(); }); +event_manager->deregister_event("event_a", h1); + +3. Invoking an event: +===================== +event_manager->invoke_event("event_a"); +Registered callbacks are dispached with no particular order. +The callbacks are exeuted in the context of the thread who invoked the event. +