Selaa lähdekoodia

evapi: documentation for evapi broadcast functions

Daniel-Constantin Mierla 9 vuotta sitten
vanhempi
commit
4fa443a3b6
2 muutettua tiedostoa jossa 95 lisäystä ja 24 poistoa
  1. 44 12
      modules/evapi/README
  2. 51 12
      modules/evapi/doc/evapi_admin.xml

+ 44 - 12
modules/evapi/README

@@ -33,8 +33,10 @@ Daniel-Constantin Mierla
 
 
               4.1. evapi_relay(evdata)
               4.1. evapi_relay(evdata)
               4.2. evapi_async_relay(evdata)
               4.2. evapi_async_relay(evdata)
-              4.3. evapi_close()
-              4.4. evapi_set_tag(tname)
+              4.3. evapi_multicast(evdata, etag)
+              4.4. evapi_async_multicast(evdata, etag)
+              4.5. evapi_close()
+              4.6. evapi_set_tag(tname)
 
 
         5. Event routes
         5. Event routes
 
 
@@ -52,8 +54,10 @@ Daniel-Constantin Mierla
    1.4. evapi_relay usage
    1.4. evapi_relay usage
    1.5. TCP message
    1.5. TCP message
    1.6. evapi_async_relay usage
    1.6. evapi_async_relay usage
-   1.7. evapi_close usage
-   1.8. evapi_set_tag usage
+   1.7. evapi_multicast usage
+   1.8. evapi_async_multicast usage
+   1.9. evapi_close usage
+   1.10. evapi_set_tag usage
 
 
 Chapter 1. Admin Guide
 Chapter 1. Admin Guide
 
 
@@ -75,8 +79,10 @@ Chapter 1. Admin Guide
 
 
         4.1. evapi_relay(evdata)
         4.1. evapi_relay(evdata)
         4.2. evapi_async_relay(evdata)
         4.2. evapi_async_relay(evdata)
-        4.3. evapi_close()
-        4.4. evapi_set_tag(tname)
+        4.3. evapi_multicast(evdata, etag)
+        4.4. evapi_async_multicast(evdata, etag)
+        4.5. evapi_close()
+        4.6. evapi_set_tag(tname)
 
 
    5. Event routes
    5. Event routes
 
 
@@ -159,8 +165,10 @@ modparam("evapi", "netstring_format", 0)
 
 
    4.1. evapi_relay(evdata)
    4.1. evapi_relay(evdata)
    4.2. evapi_async_relay(evdata)
    4.2. evapi_async_relay(evdata)
-   4.3. evapi_close()
-   4.4. evapi_set_tag(tname)
+   4.3. evapi_multicast(evdata, etag)
+   4.4. evapi_async_multicast(evdata, etag)
+   4.5. evapi_close()
+   4.6. evapi_set_tag(tname)
 
 
 4.1. evapi_relay(evdata)
 4.1. evapi_relay(evdata)
 
 
@@ -214,13 +222,37 @@ evapi_async_relay("{ \"event\": \"suspend\",\n \"data\":"
         " { \"index\": \"$T(id_index)\", \"label\": \"$T(id_label)\" }\n}");
         " { \"index\": \"$T(id_index)\", \"label\": \"$T(id_label)\" }\n}");
 ...
 ...
 
 
-4.3. evapi_close()
+4.3. evapi_multicast(evdata, etag)
+
+   Relay the event data given as parameter to connections that match the
+   tag provided by etag value. The etag can be a variable. For more see
+   evapi_relay() and evapi_set_tag().
+
+   Example 1.7. evapi_multicast usage
+...
+evapi_relay("{ \"event\": \"test\",\n \"data\": { \"fU\": \"$fU\" }\n}", "tagx")
+;
+...
+
+4.4. evapi_async_multicast(evdata, etag)
+
+   Async relay the event data given as parameter to connections that match
+   the tag provided by etag value. The etag can be a variable. For more
+   see evapi_async_relay() and evapi_set_tag().
+
+   Example 1.8. evapi_async_multicast usage
+...
+evapi_async_multicast("{ \"event\": \"suspend\",\n \"data\":"
+    " { \"index\": \"$T(id_index)\", \"label\": \"$T(id_label)\" }\n}", "tagx");
+...
+
+4.5. evapi_close()
 
 
    Close evapi current client connection.
    Close evapi current client connection.
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.7. evapi_close usage
+   Example 1.9. evapi_close usage
 ...
 ...
 event_route[evapi:connection-new] {
 event_route[evapi:connection-new] {
   if($evapi(srcaddr)!="127.0.0.1") {
   if($evapi(srcaddr)!="127.0.0.1") {
@@ -230,7 +262,7 @@ event_route[evapi:connection-new] {
 }
 }
 ...
 ...
 
 
-4.4. evapi_set_tag(tname)
+4.6. evapi_set_tag(tname)
 
 
    Set tag name for current client connection. The parameters has to be a
    Set tag name for current client connection. The parameters has to be a
    string up to 64 characters. It can also be a variable holding such
    string up to 64 characters. It can also be a variable holding such
@@ -238,7 +270,7 @@ event_route[evapi:connection-new] {
 
 
    This function can be used from ANY_ROUTE.
    This function can be used from ANY_ROUTE.
 
 
-   Example 1.8. evapi_set_tag usage
+   Example 1.10. evapi_set_tag usage
 ...
 ...
 event_route[evapi:connection-new] {
 event_route[evapi:connection-new] {
   if($evapi(srcaddr)=="127.0.0.1") {
   if($evapi(srcaddr)=="127.0.0.1") {

+ 51 - 12
modules/evapi/doc/evapi_admin.xml

@@ -127,10 +127,10 @@ modparam("evapi", "netstring_format", 0)
 	<section>
 	<section>
 	<title>Functions</title>
 	<title>Functions</title>
 	<section id="evapi.f.evapi_relay">
 	<section id="evapi.f.evapi_relay">
-	    <title>
+		<title>
 		<function moreinfo="none">evapi_relay(evdata)</function>
 		<function moreinfo="none">evapi_relay(evdata)</function>
-	    </title>
-	    <para>
+		</title>
+		<para>
 		Relay the event data given as parameter to connected applications.
 		Relay the event data given as parameter to connected applications.
 		</para>
 		</para>
 		<para>
 		<para>
@@ -154,7 +154,7 @@ modparam("evapi", "netstring_format", 0)
 evapi_relay("{ \"event\": \"test\",\n \"data\": { \"fU\": \"$fU\" }\n}");
 evapi_relay("{ \"event\": \"test\",\n \"data\": { \"fU\": \"$fU\" }\n}");
 ...
 ...
 </programlisting>
 </programlisting>
-	    </example>
+		</example>
 		<para>
 		<para>
 		The above exaple will send the following message over tcp:
 		The above exaple will send the following message over tcp:
 		</para>
 		</para>
@@ -168,14 +168,14 @@ evapi_relay("{ \"event\": \"test\",\n \"data\": { \"fU\": \"$fU\" }\n}");
 },
 },
 ...
 ...
 </programlisting>
 </programlisting>
-	    </example>
+		</example>
 	</section>
 	</section>
 
 
 	<section id="evapi.f.evapi_async_relay">
 	<section id="evapi.f.evapi_async_relay">
-	    <title>
+		<title>
 		<function moreinfo="none">evapi_async_relay(evdata)</function>
 		<function moreinfo="none">evapi_async_relay(evdata)</function>
-	    </title>
-	    <para>
+		</title>
+		<para>
 		Relay the event data given as parameter to connected applications. Before
 		Relay the event data given as parameter to connected applications. Before
 		evaluating the parameter, the request processing is suspended using
 		evaluating the parameter, the request processing is suspended using
 		tm module (using the t_suspend()/t_continue() framework). The routing
 		tm module (using the t_suspend()/t_continue() framework). The routing
@@ -199,14 +199,53 @@ evapi_async_relay("{ \"event\": \"suspend\",\n \"data\":"
         " { \"index\": \"$T(id_index)\", \"label\": \"$T(id_label)\" }\n}");
         " { \"index\": \"$T(id_index)\", \"label\": \"$T(id_label)\" }\n}");
 ...
 ...
 </programlisting>
 </programlisting>
-	    </example>
+		</example>
+	</section>
+
+	<section id="evapi.f.evapi_multicast">
+		<title>
+		<function moreinfo="none">evapi_multicast(evdata, etag)</function>
+		</title>
+		<para>
+		Relay the event data given as parameter to connections that match
+		the tag provided by etag value. The etag can be a variable. For more
+		see evapi_relay() and evapi_set_tag().
+		</para>
+		<example>
+		<title><function>evapi_multicast</function> usage</title>
+		<programlisting format="linespecific">
+...
+evapi_relay("{ \"event\": \"test\",\n \"data\": { \"fU\": \"$fU\" }\n}", "tagx");
+...
+</programlisting>
+		</example>
+	</section>
+
+	<section id="evapi.f.evapi_async_multicast">
+		<title>
+		<function moreinfo="none">evapi_async_multicast(evdata, etag)</function>
+		</title>
+		<para>
+		Async relay the event data given as parameter to connections that match
+		the tag provided by etag value. The etag can be a variable. For more
+		see evapi_async_relay() and evapi_set_tag().
+		</para>
+		<example>
+		<title><function>evapi_async_multicast</function> usage</title>
+		<programlisting format="linespecific">
+...
+evapi_async_multicast("{ \"event\": \"suspend\",\n \"data\":"
+    " { \"index\": \"$T(id_index)\", \"label\": \"$T(id_label)\" }\n}", "tagx");
+...
+</programlisting>
+		</example>
 	</section>
 	</section>
 
 
 	<section id="evapi.f.evapi_close">
 	<section id="evapi.f.evapi_close">
-	    <title>
+		<title>
 		<function moreinfo="none">evapi_close()</function>
 		<function moreinfo="none">evapi_close()</function>
-	    </title>
-	    <para>
+		</title>
+		<para>
 		Close evapi current client connection.
 		Close evapi current client connection.
 		</para>
 		</para>
 		<para>
 		<para>