Browse Source

htable: documentation for event_callback parameter

Daniel-Constantin Mierla 8 years ago
parent
commit
6dd359e3c5
1 changed files with 35 additions and 7 deletions
  1. 35 7
      modules/htable/doc/htable_admin.xml

+ 35 - 7
modules/htable/doc/htable_admin.xml

@@ -10,9 +10,9 @@
 <!-- Module User's Guide -->
 <!-- Module User's Guide -->
 
 
 <chapter>
 <chapter>
-	
+
 	<title>&adminguide;</title>
 	<title>&adminguide;</title>
-	
+
 	<section>
 	<section>
 	<title>Overview</title>
 	<title>Overview</title>
 	<para>
 	<para>
@@ -31,7 +31,7 @@
 		be adjusted per item via assignment operation at runtime.
 		be adjusted per item via assignment operation at runtime.
 	</para>
 	</para>
 	<para>
 	<para>
-		Replication between multiple servers is performed automatically (if 
+		Replication between multiple servers is performed automatically (if
 		enabled) via the DMQ module.
 		enabled) via the DMQ module.
 	</para>
 	</para>
 	<para>
 	<para>
@@ -621,9 +621,9 @@ modparam("htable", "db_expires", 1)
 	<section id="htable.p.enable_dmq">
 	<section id="htable.p.enable_dmq">
 		<title><varname>enable_dmq</varname> (integer)</title>
 		<title><varname>enable_dmq</varname> (integer)</title>
 		<para>
 		<para>
-			If set to 1, will enable DMQ replication of actions performed upon 
-			entries in all tables having "dmqreplicate" parameter set. Any update 
-			action performed via pseudo-variables, MI and RPC commands will be 
+			If set to 1, will enable DMQ replication of actions performed upon
+			entries in all tables having "dmqreplicate" parameter set. Any update
+			action performed via pseudo-variables, MI and RPC commands will be
 			repeated on all other nodes. Therefore, it is important to ensure the
 			repeated on all other nodes. Therefore, it is important to ensure the
 			table definition (size, autoexpire etc.) is identical across all instances.
 			table definition (size, autoexpire etc.) is identical across all instances.
 		</para>
 		</para>
@@ -633,7 +633,7 @@ modparam("htable", "db_expires", 1)
 		</emphasis>
 		</emphasis>
 		</para>
 		</para>
 		<para>
 		<para>
-			Currently, values are not replicated on load from DB as it is expected 
+			Currently, values are not replicated on load from DB as it is expected
 			that in these cases, all servers will load their values from the same DB.
 			that in these cases, all servers will load their values from the same DB.
 		</para>
 		</para>
 		<para>
 		<para>
@@ -669,6 +669,34 @@ modparam("htable", "enable_dmq", 1)
 ...
 ...
 modparam("htable", "timer_procs", 4)
 modparam("htable", "timer_procs", 4)
 ...
 ...
+</programlisting>
+		</example>
+	</section>
+	<section id="htable.p.event_callback">
+		<title><varname>event_callback</varname> (str)</title>
+		<para>
+			The name of the function in the kemi configuration file (embedded
+			scripting language such as Lua, Python, ...) to be executed instead
+			of event_route[...] blocks. The function receives a string parameter
+			with the name of the event.
+		</para>
+		<para>
+		<emphasis>
+			Default value is 'empty' (no function is executed for events).
+		</emphasis>
+		</para>
+		<example>
+		<title>Set <varname>event_callback</varname> parameter</title>
+		<programlisting format="linespecific">
+...
+modparam("htable", "event_callback", "ksr_htable_event")
+...
+-- event callback function implemented in Lua
+function ksr_htable_event(evname)
+	KSR.info("===== htable module triggered event: " .. evname .. "\n");
+	return 1;
+end
+...
 </programlisting>
 </programlisting>
 		</example>
 		</example>
 	</section>
 	</section>