You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2019/10/13 23:31:09 UTC

[tcl-rivet] branch quattuor updated (a914d8b -> ba802ce)

This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a change to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git.


    from a914d8b  argument checking revision
     new 4f6a0a8  documentation improvements
     new ba802ce  documenting changes to the bridge API

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog                                   |  4 +++
 doc/examples-sgml/myapp_request_handler.tcl |  8 +++---
 doc/examples/myapp_request_handler.tcl      | 33 +++++++++++-----------
 doc/xml/directives.xml                      | 38 +++++++++++++++----------
 doc/xml/internals.xml                       | 43 +++++++++++++++++------------
 doc/xml/processing.xml                      |  2 +-
 doc/xml/request.xml                         |  2 +-
 7 files changed, 75 insertions(+), 55 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org


[tcl-rivet] 02/02: documenting changes to the bridge API

Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit ba802cee05d600e26fcd356cd0865f3d573b8c7b
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Mon Oct 14 01:30:54 2019 +0200

    documenting changes to the bridge API
---
 ChangeLog             |  2 +-
 doc/xml/internals.xml | 43 +++++++++++++++++++++++++------------------
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c3a69d5..4b9d450 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
 2019-10-13 Massimo Manghi <mx...@apache.org>
     * doc/xml/directives.xml: configuration directives table expanded
-    * doc/examples/
+    * doc/xml/internals.xml: documenting the changes in the bridge API
 
 2019-09-30 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet_ng/rivetCore.c: revised argument checking
diff --git a/doc/xml/internals.xml b/doc/xml/internals.xml
index 24c9f69..5bec822 100644
--- a/doc/xml/internals.xml
+++ b/doc/xml/internals.xml
@@ -69,28 +69,30 @@
 			We designed an interface between the core of mod_rivet and its MPM bridges 
 			based on a set of functions defined in the rivet_bridge_table structure. 
     	</para>
-    	<programlisting>typedef struct _mpm_bridge_table {
-    RivetBridge_ServerInit    *mpm_server_init;
-    RivetBridge_ChildInit     *mpm_child_init;
-    RivetBridge_Request       *mpm_request;
-    RivetBridge_Finalize      *mpm_finalize;
-    RivetBridge_Exit_Handler  *mpm_exit_handler;
-    RivetBridge_Thread_Interp *mpm_thread_interp;
+		<programlisting>typedef struct _mpm_bridge_table {
+    RivetBridge_ServerInit      *server_init;
+    RivetBridge_ThreadInit      *thread_init;
+    RivetBridge_Request         *request_processor;
+    RivetBridge_Finalize        *thread_finalize;
+    RivetBridge_Exit_Handler    *exit_handler;
+    RivetBridge_Thread_Interp   *thread_interp;
+    RivetBridge_InheritsInterps  inherits_interps;
 } rivet_bridge_table;</programlisting>
 		<para>
 			<itemizedlist>
 				<listitem>
-					<emphasis>mpm_server_init</emphasis>: pointer to any
+					<emphasis>server_init</emphasis>: pointer to any
 					specific server inititalization function. This field can be NULL
 					if no bridge specific initialization has to be done. The core of
 					mod_rivet runs the <command>ServerInitScript</command> before
-					calling this function.</listitem>
-					<listitem><emphasis>mpm_child_init</emphasis>: Bridge specific
+					calling this function.
+				</listitem>
+				<listitem><emphasis>thread_init</emphasis>: Bridge specific
 					child process initialization. If the pointer is assigned with
 					a non-NULL value the function is called by Rivet_ChildInit. 
 				</listitem>
 				<listitem>
-					<emphasis>mpm_request</emphasis>: This pointer must
+					<emphasis>request_processor</emphasis>: This pointer must
 					be a valid function pointer to the content generator
 					implemented by the bridge. If the pointer is not defined the Apache
 					web server will stop at start up. This condition is motivated by
@@ -107,19 +109,24 @@
 					are no threads and the bridge calls directly Rivet_SendContent
 				</listitem>
 				<listitem>
-					<emphasis>mpm_finalize</emphasis>: pointer to a finalization
+					<emphasis>thread_finalize</emphasis>: pointer to a finalization
 					function called during a child process exit. This function is registered
 					as child process memory pool cleanup function. If the pointer is NULL
 					the pool is given a default cleanup function (apr_pool_cleanup_null) 
-					defined in src/mod_rivet/mod_rivet.c. For instance the finalize function
-					in the <emphasis>worker</emphasis> MPM bridge notifies
-					a supervisor thread demanding the whole pool of threads running Tcl 
-					interpreters to orderly exit. This pointer can be NULL if the bridge 
+					defined in src/mod_rivet/mod_rivet.c. In the prefork bridge this function
+					this function will do nothing really interesting, but with the lazy and worker
+					bridges its behavior can change depending on the <command>SingleThreadExit</command>
+					directive. By default (<command>SingleThreadExit</command>: Off)
+					in the <emphasis>worker</emphasis> and the <emphasis>lazy</emphasis>MPM bridges
+					notify the whole pool of threads running Tcl 
+					interpreters to orderly exit. If <command>SingleThreadExit</command> is On
+					then a single Tcl thread terminates deleting its interpreter and I/O channel.
+					This pointer can be NULL if the bridge 
 					has no special need when a child process must exit (unlikely if you have
 					multiple threads running)
 				</listitem>
 				<listitem>
-					<emphasis>mpm_exit_handler</emphasis>: mod_rivet replaces
+					<emphasis>exit_handler</emphasis>: mod_rivet replaces
 					the core <command>exit</command> command with a new one
 					(<command>::rivet::exit</command>). This command must handle 
 					the process exit in the best possible way for the bridge and the
@@ -137,7 +144,7 @@
 					to have details on how and at what stage this callback is invoked.
 				</listitem>
 				<listitem>
-					<emphasis>mpm_thread_interp</emphasis> must be a function returning
+					<emphasis>thread_interp</emphasis> must be a function returning
 					the interpreter object (a pointer to record of type
 					<command>rivet_thread_interp</command>) associated
 					to a given configuration as stored in a <command>rivet_server_conf*</command>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org


[tcl-rivet] 01/02: documentation improvements

Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch quattuor
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git

commit 4f6a0a845af70706206bfef6b9b88179f4b8e4e3
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Sun Oct 13 23:56:28 2019 +0200

    documentation improvements
---
 ChangeLog                                   |  4 +++
 doc/examples-sgml/myapp_request_handler.tcl |  8 +++---
 doc/examples/myapp_request_handler.tcl      | 33 ++++++++++++-------------
 doc/xml/directives.xml                      | 38 ++++++++++++++++++-----------
 doc/xml/processing.xml                      |  2 +-
 doc/xml/request.xml                         |  2 +-
 6 files changed, 50 insertions(+), 37 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cfc6f8a..c3a69d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-10-13 Massimo Manghi <mx...@apache.org>
+    * doc/xml/directives.xml: configuration directives table expanded
+    * doc/examples/
+
 2019-09-30 Massimo Manghi <mx...@apache.org>
     * src/mod_rivet_ng/rivetCore.c: revised argument checking
 
diff --git a/doc/examples-sgml/myapp_request_handler.tcl b/doc/examples-sgml/myapp_request_handler.tcl
index 2ba192b..9af42e0 100644
--- a/doc/examples-sgml/myapp_request_handler.tcl
+++ b/doc/examples-sgml/myapp_request_handler.tcl
@@ -1,13 +1,13 @@
 # -- myapp_request_handler.tcl
 #
-# This script will be read by mod_rivet at the thread initialization
-# stage and its content stored in a Tcl_Obj object. This object will
-# be evaluated calling Tcl_EvalObjExe
+# This script will be read by mod_rivet during the process/thread 
+# initialization stage and its content stored in a Tcl_Obj object. 
+# This object is evaluated internally by mod_rivet
 #
 
 ::try {
 
-    $::theApplication request_processing [::rivet::var_qs all]
+    ::theApplication request_processing [::rivet::var_qs all]
 
 } trap {RIVET ABORTPAGE} {err opts} {
 
diff --git a/doc/examples/myapp_request_handler.tcl b/doc/examples/myapp_request_handler.tcl
index 7bc724e..83e65b6 100644
--- a/doc/examples/myapp_request_handler.tcl
+++ b/doc/examples/myapp_request_handler.tcl
@@ -1,8 +1,8 @@
 # -- myapp_request_handler.tcl
 #
-# This script will be read by mod_rivet at the thread initialization
-# stage and its content stored in a Tcl_Obj object. This object will
-# be evaluated calling Tcl_EvalObjExe
+# This script will be read by mod_rivet during the process/thread
+# initialization stage and its content stored in a Tcl_Obj object.
+# This object is evaluated internally by mod_rivet at every request
 #
 
 ::try {
@@ -11,22 +11,21 @@
 
 } trap {RIVET ABORTPAGE} {err opts} {
 
-     set abort_code [::rivet::abort_code]
+    set abort_code [::rivet::abort_code]
 
     switch $abort_code {
-       code1 {
-           # handling abort_page with code1
-           ....
-       }
-       code2 {
-           # handling abort_page with code2
-          ....      
-       }
-       # ...
-       default {
-           # default abort handler
-       }
-   }
+        code1 {
+            # handling abort_page with code1
+            ....
+        }
+        code2 {
+            # handling abort_page with code2
+            ....      
+        }
+        default {
+            # default abort handler
+        }
+    }
 
 } trap {RIVET THREAD_EXIT} {err opts} {
     
diff --git a/doc/xml/directives.xml b/doc/xml/directives.xml
index 500fa25..38113fc 100644
--- a/doc/xml/directives.xml
+++ b/doc/xml/directives.xml
@@ -46,9 +46,8 @@
 &lt;Directory /var/www/myrivetapp&gt;
     RivetDirConf BeforeScript &quot;source /var/www/myrivetapp/before_script.tcl&quot;
 &lt;/Directory&gt;</programlisting>
-	   
-	</section>	
-	
+	</section>
+
 	<section>
 		<title>Configuration Directives</title>
 		<table align="center" title="Configuration Directives application scopes" class="directives">
@@ -56,24 +55,35 @@
 				<td>Configuration Directives</td><td>DirConf</td><td>UserConf</td><td>ServerConf</td><td>Virtual Host</td><td>Notes</td>
 			</thead>
 			<tbody>
-				<tr><td>AbortScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
-				<tr><td>AfterScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
-				<tr><td>AfterEveryScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
-				<tr><td>BeforeScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 
+				<tr><td>AbortScript</td><td>X</td><td>X</td><td>X</td><td>X</td>
+					<td>This directive is meaningful with the default request handler. In order
+					to have this triggered by calling ::rivet::abort_page or ::rivet::exit
+					any special request handler should explicitly read this script from the configuration
+					using ::rivet::inspect and evaluate it (see <xref linkend="request">request processing</xref>)</td>
+				</tr>
+				<tr><td>AfterScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td>Special request handler developers
+				should read this script from the configuration calling ::rivet::inspect and evaluate it</td></tr>
+				<tr><td>AfterEveryScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td>See notes for the AfterScript directive</td></tr>
+				<tr><td>BeforeScript</td><td>X</td><td>X</td><td>X</td><td>X</td>
+					 <td>See notes for the AfterScript directive</td></tr>
 				<tr><td>CacheSize</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>ChildExitScript</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
-				<tr><td>ChildInitScript</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
-				<tr><td>ErrorScript</td><td>X</td><td>X</td><td>X</td><td>X</td><td></td></tr> 				
+				<tr><td>ChildExitScript</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
+				<tr><td>ChildInitScript</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
+				<tr><td>ErrorScript</td><td>X</td><td>X</td><td>X</td><td>X</td>
+					<td>Rivet provides a default error handler. In case you are developing your own request
+					handling procedure you need to call that handler yourself or develop a new.
+					See notes for the AbortScript and AfterScript directives</td></tr>
 				<tr><td>ExportRivetNS</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>GlobalInitScript</td><td></td><td></td><td>X</td><td></td><td>effective only when SeparateVirtualInterps is Off (default)</td></tr> 
-				<tr><td>ImportRivetNS</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>HonorHeaderOnlyRequests</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
+				<tr><td>GlobalInitScript</td><td></td><td></td><td>X</td><td></td>
+				    <td>effective only when SeparateVirtualInterps is Off (default)</td></tr>
+				<tr><td>ImportRivetNS</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
+				<tr><td>HonorHeaderOnlyRequests</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
 				<tr><td>MpmBridge</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
 				<tr><td>RequestHandler</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
 				<tr><td>SeparateChannels</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr> 
 				<tr><td>SeparateVirtualInterps</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr> 
 				<tr><td>ServerInitScript</td><td></td><td></td><td>X</td><td></td><td></td></tr>
-				<tr><td>SingleThreadExit</td><td></td><td></td><td>X</td><td></td><td>global setting only</td></tr>
+				<tr><td>SingleThreadExit</td><td></td><td></td><td>X</td><td></td><td>global setting</td></tr>
 				<tr><td>UploadDirectory</td><td></td><td>X</td><td>X</td><td>X</td><td></td></tr> 
 				<tr><td>UploadFilesToVar</td><td></td><td></td><td>X</td><td></td><td></td></tr> 
 				<tr><td>UploadMaxSize</td><td></td><td></td><td>X</td><td>X</td><td></td></tr>
diff --git a/doc/xml/processing.xml b/doc/xml/processing.xml
index 763e922..f4a9297 100644
--- a/doc/xml/processing.xml
+++ b/doc/xml/processing.xml
@@ -3,7 +3,7 @@
 	<section>
 		<title>Tcl Scripts Processing</title>
 		<para>
-			The mod_rivet &version2-series; modules handle an HTTP request
+			The mod_rivet &version2-generic; modules handle an HTTP request
 			by running a Tcl script or a Rivet (.rvt file) template 
 			whose path appears encoded in the URI (an alias translation or 
 			URL rewriting might occur to establish the real path). 
diff --git a/doc/xml/request.xml b/doc/xml/request.xml
index d41b811..22dd93e 100644
--- a/doc/xml/request.xml
+++ b/doc/xml/request.xml
@@ -11,7 +11,7 @@
             agents when the workload is requiring it. 
        </para>
        <para>
-            Apache Rivet &version2-series; supported only the
+            Apache Rivet &version2-generic; supported only the
             <ulink url="&apachedoc-prefork;">prefork</ulink>
             MPM which creates child processes as independent agents responding to network requests. 
             Starting with &version30; also the <ulink url="&apachedoc-worker;">worker</ulink> and


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org