From c58c9b8d151dc50d9a1b1d54afed6bbe0e073fa6 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 5 Jul 2016 11:50:42 +0200 Subject: [PATCH] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 84e73cf7..018cd530 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,8 @@ To navigate it with your favorite browser: ### Crash Course +##### The Loop and the Handle + There is only one rule when using `uvw`: always initialize the handles and close them. Handles keep themselves alive until one closes them. Because of that, leaks are possible if users simply forget about a handle. To be honest, initialization is performed under the hood and can be even passed over, as far as resources are created using the `Loop::handle` member method. @@ -125,6 +127,8 @@ No need to keep track of them. To know what are the available handles' types, please refer the API reference. +##### The event-based approach + For `uvw` offers an event-based approach, handles are small event emitters to which listeners can be attached. Attaching a listener to a handle is the reccomended way to be notified about changes. Listeners must be callable objects of type `void(const EventType &, HandleType &)`, where: