You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by js...@apache.org on 2016/11/01 15:22:42 UTC
[trafficserver] 03/03: Trying better enumeration support.
This is an automated email from the ASF dual-hosted git repository.
jsime pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git
commit 5562d87db6ab4e734a4eaab6bc507f05b9d2af5c
Author: Alan M. Carroll <so...@yahoo-inc.com>
AuthorDate: Thu Oct 20 16:02:01 2016 -0500
Trying better enumeration support.
---
doc/appendices/command-line/traffic_ctl.en.rst | 9 ++---
.../api/functions/TSLifecycleHookAdd.en.rst | 40 ++++++++++++++++------
2 files changed, 35 insertions(+), 14 deletions(-)
diff --git a/doc/appendices/command-line/traffic_ctl.en.rst b/doc/appendices/command-line/traffic_ctl.en.rst
index cfb2bb0..7c56650 100644
--- a/doc/appendices/command-line/traffic_ctl.en.rst
+++ b/doc/appendices/command-line/traffic_ctl.en.rst
@@ -247,10 +247,10 @@ traffic_ctl server
traffic_ctl storage
-------------------
.. program:: traffic_ctl storage
-.. option:: offline DEVICE [DEVICE ...]
+.. option:: offline PATH [PATH ...]
Mark a cache storage device as offline. The storage is identified
- by a *path* which must match exactly a path specified in
+ by :arg:`PATH` which must match exactly a path specified in
:file:`storage.config`. This removes the storage from the cache
and redirects requests that would have used this storage to other
storage. This has exactly the same effect as a disk failure for
@@ -262,9 +262,10 @@ traffic_ctl plugin
.. program:: traffic_ctl plugin
.. option:: msg TAG DATA
- Send a message to plugins. All plugins that have hooked the :c:member:`TS_LIFECYCLE_MSG_HOOK`
+ Send a message to plugins. All plugins that have hooked the :cpp:enumerator:`TSLifecycleHookID::TS_LIFECYCLE_MSG_HOOK`
will receive a callback for that hook. The :arg:`TAG` and :arg:`DATA` will be available to the
- plugin hook processing.
+ plugin hook processing. It is expected that plugins will use :arg:`TAG` to select relevant messages
+ and determine the format of the :arg:`DATA`.
Examples
========
diff --git a/doc/developer-guide/api/functions/TSLifecycleHookAdd.en.rst b/doc/developer-guide/api/functions/TSLifecycleHookAdd.en.rst
index a15f21f..24ef96d 100644
--- a/doc/developer-guide/api/functions/TSLifecycleHookAdd.en.rst
+++ b/doc/developer-guide/api/functions/TSLifecycleHookAdd.en.rst
@@ -46,9 +46,11 @@ is always called before another unless specifically mentioned.
Types
=====
-.. :c:type:: TSLifecycleHookID
+.. cpp:enum:: TSLifecycleHookID
- .. c:member:: TS_LIFECYCLE_PORTS_INITIALIZED_HOOK
+ Life cycle hook selector.
+
+ .. cpp:enumerator:: TS_LIFECYCLE_PORTS_INITIALIZED_HOOK
Called after the :ts:cv:`proxy server port <proxy.config.http.server_ports>`
data structures have been initialized but before connections are accepted on
@@ -60,7 +62,7 @@ Types
Invoked with the event :c:data:`TS_EVENT_LIFECYCLE_PORTS_INITIALIZED` and
``NULL`` data.
- .. c:member:: TS_LIFECYCLE_PORTS_READY_HOOK
+ .. cpp:enumerator:: TS_LIFECYCLE_PORTS_READY_HOOK
Called after enabling connections on the proxy server ports. Because |TS| is
threaded this may or may not be called before any connections are accepted.
@@ -71,34 +73,52 @@ Types
Invoked with the event :c:data:`TS_EVENT_LIFECYCLE_PORTS_READY` and ``NULL``
data.
- .. c:member:: TS_LIFECYCLE_CACHE_READY_HOOK
+ .. cpp:enumerator:: TS_LIFECYCLE_CACHE_READY_HOOK
Called after |TS| cache initialization has finished.
Invoked with the event :c:data:`TS_EVENT_LIFECYCLE_CACHE_READY` and ``NULL``
data.
- .. c:member:: TS_LIFECYCLE_MSG_HOOK
+ .. cpp:enumerator:: TS_LIFECYCLE_MSG_HOOK
Called when triggered by an external process, such as :program:`traffic_ctl`.
Invoked with the event :c:data:`TS_EVENT_LIFECYCLE_MSG`. The data is an instance of the
:c:type:`TSPluginMsg`. This contains a *tag* which is a null terminated string and a data payload.
- The payload cannot be assumed to be null terminated and is created by the external agent.
+ The payload cannot be assumed to be null terminated and is created by the external agent. Its internal
+ structure and format are entirely under the control of the external agent although presumably there is
+ an agreement between the plugin and the external where this is determined by the :arg:`tag`.
- .. c:member:: TS_LIFECYCLE_CLIENT_SSL_CTX_INITIALIZED_HOOK
+ .. cpp:enumerator:: TS_LIFECYCLE_CLIENT_SSL_CTX_INITIALIZED_HOOK
Called after the initialization of the SSL context used by |TS| for outbound connections (|TS| as client).
- .. c:member:: TS_LIFECYCLE_SERVER_SSL_CTX_INITIALIZED_HOOK
+ .. cpp:enumerator:: TS_LIFECYCLE_SERVER_SSL_CTX_INITIALIZED_HOOK
Called after every SSL context initialization used by |TS| for inbound connections (|TS| as the server).
+
+.. c:type:: TSPluginMsg
+
+ The format of the data for the plugin message event :c:data:`TS_EVENT_LIFECYCLE_MSG`.
+
+.. c:member:: const char * TSPluginMsg::tag
+
+ The tag of the message. This is a null terminated string.
+
+.. c:member:: const void * TSPluginMsg::data
+
+ Message data (payload). This is a raw slab of bytes - no structure is guaranteed.
+
+.. c:member:: size_t TSPluginMsg::data_size
+
+ The size of :member:`TSPluginMsg::data`.
Ordering
========
-:c:member:`TS_LIFECYCLE_PORTS_INITIALIZED_HOOK` will always be called before
-:c:member:`TS_LIFECYCLE_PORTS_READY_HOOK`.
+:cpp:enumerator:`TSLifecycleHookID::TS_LIFECYCLE_PORTS_INITIALIZED_HOOK` will always be called before
+:cpp:enumerator:`TSLifecycleHookID::TS_LIFECYCLE_PORTS_READY_HOOK`.
Examples
========
--
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.