Adapt documentation of event subscription methods 2.1-pre2
authorJohannes Schanda <schanda@itestra.de>
Wed, 10 Jul 2013 08:32:20 +0000 (10:32 +0200)
committerJohannes Schanda <schanda@itestra.de>
Wed, 10 Jul 2013 08:32:20 +0000 (10:32 +0200)
Explain illegal proxy building in callbacks
Offer suggestions for how to avoid this issue

src/CommonAPI/Event.h

index b86f58c..b032da9 100644 (file)
@@ -43,7 +43,12 @@ class Event {
        /**
         * \brief Subscribe a listener to this event
         *
-        * Subscribe a listener to this event
+        * Subscribe a listener to this event.
+        * ATTENTION: You should not build new proxies or register services in callbacks
+        * from events. This can cause a deadlock or assert. Instead, you should set a
+        * trigger for your application to do this on the next iteration of your event loop
+        * if needed. The preferred solution is to build all proxies you need at the
+        * beginning and react to events appropriatly for each.
         *
         * @param listener A listener to be added
         * @return A token identifying this subscription
@@ -54,6 +59,11 @@ class Event {
      * \brief Subscribe a cancellable listener to this event
      *
      * Subscribe a cancellable listener to this event
+     * ATTENTION: You should not build new proxies or register services in callbacks
+     * from events. This can cause a deadlock or assert. Instead, you should set a
+     * trigger for your application to do this on the next iteration of your event loop
+     * if needed. The preferred solution is to build all proxies you need at the
+     * beginning and react to events appropriatly for each.
      *
      * @param listener A cancellable listener to be added
      * @return A token identifying this subscription