-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin-coordination.en.html
172 lines (164 loc) · 8.8 KB
/
plugin-coordination.en.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Plugin Coordination — AMC Traffic Server Documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinxdoc.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Administrative JSON RPC" href="RPC.en.html" />
<link rel="prev" title="Layer 4 Proxying" href="l4r.en.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="RPC.en.html" title="Administrative JSON RPC"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="l4r.en.html" title="Layer 4 Proxying"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">SWOC Docs</a> »</li>
<li class="nav-item nav-item-1"><a href="ats-projects.en.html" accesskey="U">Traffic Server Projects</a> »</li>
<li class="nav-item nav-item-this"><a href="">Plugin Coordination</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="plugin-coordination">
<span id="id1"></span><h1>Plugin Coordination<a class="headerlink" href="#plugin-coordination" title="Permalink to this headline">¶</a></h1>
<p>It has been requested for a long time to be able to have coordination among plugins. The two most
commonly requested capabilities are</p>
<ul class="simple">
<li><p>Force the callback for plugin A to run before / after the callback for plugin B on a specific hook.</p></li>
<li><p>Disable a plugin and / or callback for a specific hook for a specific transaction.</p></li>
</ul>
<p>I had a version of this ready for production testing, based on the Yahoo! 5.3 fork of Traffic Server. Based on
that work there are a number of other features that are implicit in making the primary capabilities
possible.</p>
<dl class="simple">
<dt>Modular hook dispatch.</dt><dd><p>To make this work consistently, it is very desirable to create a class to handle the hook
dispatching. This provides a uniform code base to handle callback dispatch.</p>
</dd>
<dt>Continuation tracking</dt><dd><p>Each continuation needs to be tracked back to the original plugin (or core) that created it in
order to correctly handle when or if the callback is dispatched. This has the ancillary benefit
of being able to provide more detailed debugging and failure messages when something goes wrong
with a continuation. In theory this may also make it possible to handle plugin reload so that
events for continuations associated with an unloaded plugin can be dropped instead of brokenly
dispatched.</p>
</dd>
<dt>Plugin API to probe hooks for callbacks.</dt><dd><p>If callbacks are going to be controllable from plugins, it is also needful to allow plugins to check the callbackson a hook. This is another plugin developer request that has been around for a while.</p>
</dd>
<dt>Plugin API to manipulate callbacks on hooks</dt><dd><p>Once callbacks are accessible via inspection from the previous point, a request for the ability
to manipulate them is inevitable.</p>
</dd>
</dl>
<section id="phases">
<h2>Phases<a class="headerlink" href="#phases" title="Permalink to this headline">¶</a></h2>
<p>The full change is large and should be broken up into smaller updates, each of which provides some
independent value. The natural progression is basically the feature list from the previous section. In this progression each update depends on the previous one.</p>
<ol class="arabic simple">
<li><p>Modularize the callback dispatch. Handle the three levels of dispatch (global, session,
transaction) in a consistent way.</p></li>
<li><p>Track continuations. Each continuation is either from the core or from a plugin. Associate the
data for this with each continuation and whenever a continuation is created use the current plugin
context to mark it.</p></li>
<li><p>Plugin priorities, implementation and configuration. This assigns priorities to plugins and
dispatches callbacks in priority order. This must also include the capability to configure at
least statically the priorities for the plugins.</p></li>
<li><p>Plugin priority API. This enables plugins to manipulate plugin priorities in code. This includes
both adjusting priorities and enabling / disabling plugins for a transaction, and setting the
priority threshold for a hook.</p></li>
<li><p>Callback inspection plugin API. Enable plugins to examine the callbacks associated with a hook.</p></li>
<li><p>Callback manipluation plugin API. Enable plugins to manipulate the callbacks on a hook, including
changing priorities and enabling / disabling specific callbacks or plugins for a hook.</p></li>
</ol>
</section>
<section id="history">
<h2>History<a class="headerlink" href="#history" title="Permalink to this headline">¶</a></h2>
<p>At one point (Feb 2016) I had a working prototype of plugin priorities based on the YahoO! 5.3.x
fork which assigned priorities to plugin callbacks along with an API to manipulate not just the
current plugins priorities but that of other plugins. Although useful, to make it work in production
it was necessary to add plugin level enable / disable. The code for this is
<a class="reference external" href="https://github.com/SolidWallOfCode/trafficserver/tree/plugin-coordination">here</a>.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/balcora-gate-400x400.jpg" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Plugin Coordination</a><ul>
<li><a class="reference internal" href="#phases">Phases</a></li>
<li><a class="reference internal" href="#history">History</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="l4r.en.html"
title="previous chapter">Layer 4 Proxying</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="RPC.en.html"
title="next chapter">Administrative JSON RPC</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/plugin-coordination.en.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="RPC.en.html" title="Administrative JSON RPC"
>next</a> |</li>
<li class="right" >
<a href="l4r.en.html" title="Layer 4 Proxying"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">SWOC Docs</a> »</li>
<li class="nav-item nav-item-1"><a href="ats-projects.en.html" >Traffic Server Projects</a> »</li>
<li class="nav-item nav-item-this"><a href="">Plugin Coordination</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2017, [email protected].
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
</div>
</body>
</html>