Modified: websites/staging/thrift/trunk/content/tutorial/perl.html ============================================================================== --- websites/staging/thrift/trunk/content/tutorial/perl.html (original) +++ websites/staging/thrift/trunk/content/tutorial/perl.html Fri Nov 20 17:19:21 2020 @@ -121,7 +121,7 @@ h2:hover > .headerlink, h3:hover > .head <span class="n">use</span> <span class="n">warnings</span><span class="p">;</span> <span class="n">use</span> <span class="n">lib</span> <span class="s1">'../../lib/perl/lib'</span><span class="p">;</span> -<span class="n">use</span> <span class="n">lib</span> <span class="s1">'../gen-perl'</span><span class="p">;</span> +<span class="n">use</span> <span class="n">lib</span> <span class="s1">'gen-perl'</span><span class="p">;</span> <span class="n">use</span> <span class="no">Thrift</span><span class="p">;</span> <span class="n">use</span> <span class="no">Thrift</span><span class="o">::</span><span class="no">BinaryProtocol</span><span class="p">;</span> @@ -197,7 +197,8 @@ h2:hover > .headerlink, h3:hover > .head <div class="codehilite"><pre><span class="c1">#</span> <span class="n">use</span> <span class="n">strict</span><span class="p">;</span> -<span class="n">use</span> <span class="n">lib</span> <span class="s1">'../gen-perl'</span><span class="p">;</span> +<span class="n">use</span> <span class="n">lib</span> <span class="s1">'../../lib/perl/lib'</span><span class="p">;</span> +<span class="n">use</span> <span class="n">lib</span> <span class="s1">'gen-perl'</span><span class="p">;</span> <span class="n">use</span> <span class="no">Thrift</span><span class="o">::</span><span class="no">Socket</span><span class="p">;</span> <span class="n">use</span> <span class="no">Thrift</span><span class="o">::</span><span class="no">Server</span><span class="p">;</span> <span class="n">use</span> <span class="no">Thrift</span><span class="o">::</span><span class="no">ServerSocket</span><span class="p">;</span> @@ -259,7 +260,6 @@ h2:hover > .headerlink, h3:hover > .head <span class="p">}</span> <span class="n">my</span> <span class="vg">$log</span> <span class="o">=</span> <span class="n">shared</span><span class="o">::</span><span class="no">SharedStruct</span><span class="o">-></span><span class="kp">new</span><span class="p">();</span> - <span class="vg">$log</span><span class="o">-></span><span class="n">key</span><span class="p">(</span><span class="vg">$logid</span><span class="p">);</span> </pre></div> <p class='snippet_footer'>
Modified: websites/staging/thrift/trunk/content/tutorial/php.html ============================================================================== --- websites/staging/thrift/trunk/content/tutorial/php.html (original) +++ websites/staging/thrift/trunk/content/tutorial/php.html Fri Nov 20 17:19:21 2020 @@ -125,7 +125,7 @@ h2:hover > .headerlink, h3:hover > .head <span class="k">use</span> <span class="nx">Thrift\ClassLoader\ThriftClassLoader</span><span class="p">;</span> -<span class="nv">$GEN_DIR</span> <span class="o">=</span> <span class="nb">realpath</span><span class="p">(</span><span class="nb">dirname</span><span class="p">(</span><span class="k">__FILE__</span><span class="p">)</span><span class="o">.</span><span class="s1">'/..'</span><span class="p">)</span><span class="o">.</span><span class="s1">'/gen-php'</span><span class="p">;</span> +<span class="nv">$GEN_DIR</span> <span class="o">=</span> <span class="nb">realpath</span><span class="p">(</span><span class="nb">dirname</span><span class="p">(</span><span class="k">__FILE__</span><span class="p">))</span><span class="o">.</span><span class="s1">'/gen-php'</span><span class="p">;</span> <span class="nv">$loader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ThriftClassLoader</span><span class="p">();</span> <span class="nv">$loader</span><span class="o">-></span><span class="na">registerNamespace</span><span class="p">(</span><span class="s1">'Thrift'</span><span class="p">,</span> <span class="nx">__DIR__</span> <span class="o">.</span> <span class="s1">'/../../lib/php/lib'</span><span class="p">);</span> @@ -235,7 +235,7 @@ h2:hover > .headerlink, h3:hover > .head <span class="k">use</span> <span class="nx">Thrift\ClassLoader\ThriftClassLoader</span><span class="p">;</span> -<span class="nv">$GEN_DIR</span> <span class="o">=</span> <span class="nb">realpath</span><span class="p">(</span><span class="nb">dirname</span><span class="p">(</span><span class="k">__FILE__</span><span class="p">)</span><span class="o">.</span><span class="s1">'/..'</span><span class="p">)</span><span class="o">.</span><span class="s1">'/gen-php'</span><span class="p">;</span> +<span class="nv">$GEN_DIR</span> <span class="o">=</span> <span class="nb">realpath</span><span class="p">(</span><span class="nb">dirname</span><span class="p">(</span><span class="k">__FILE__</span><span class="p">))</span><span class="o">.</span><span class="s1">'/gen-php'</span><span class="p">;</span> <span class="nv">$loader</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ThriftClassLoader</span><span class="p">();</span> <span class="nv">$loader</span><span class="o">-></span><span class="na">registerNamespace</span><span class="p">(</span><span class="s1">'Thrift'</span><span class="p">,</span> <span class="nx">__DIR__</span> <span class="o">.</span> <span class="s1">'/../../lib/php/lib'</span><span class="p">);</span> Modified: websites/staging/thrift/trunk/content/tutorial/py.html ============================================================================== --- websites/staging/thrift/trunk/content/tutorial/py.html (original) +++ websites/staging/thrift/trunk/content/tutorial/py.html Fri Nov 20 17:19:21 2020 @@ -234,16 +234,10 @@ h2:hover > .headerlink, h3:hover > .head <span class="n">val</span> <span class="o">=</span> <span class="n">work</span><span class="o">.</span><span class="n">num1</span> <span class="o">*</span> <span class="n">work</span><span class="o">.</span><span class="n">num2</span> <span class="k">elif</span> <span class="n">work</span><span class="o">.</span><span class="n">op</span> <span class="o">==</span> <span class="n">Operation</span><span class="o">.</span><span class="n">DIVIDE</span><span class="p">:</span> <span class="k">if</span> <span class="n">work</span><span class="o">.</span><span class="n">num2</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> - <span class="n">x</span> <span class="o">=</span> <span class="n">InvalidOperation</span><span class="p">()</span> - <span class="n">x</span><span class="o">.</span><span class="n">whatOp</span> <span class="o">=</span> <span class="n">work</span><span class="o">.</span><span class="n">op</span> - <span class="n">x</span><span class="o">.</span><span class="n">why</span> <span class="o">=</span> <span class="s">'Cannot divide by 0'</span> - <span class="k">raise</span> <span class="n">x</span> + <span class="k">raise</span> <span class="n">InvalidOperation</span><span class="p">(</span><span class="n">work</span><span class="o">.</span><span class="n">op</span><span class="p">,</span> <span class="s">'Cannot divide by 0'</span><span class="p">)</span> <span class="n">val</span> <span class="o">=</span> <span class="n">work</span><span class="o">.</span><span class="n">num1</span> <span class="o">/</span> <span class="n">work</span><span class="o">.</span><span class="n">num2</span> <span class="k">else</span><span class="p">:</span> - <span class="n">x</span> <span class="o">=</span> <span class="n">InvalidOperation</span><span class="p">()</span> - <span class="n">x</span><span class="o">.</span><span class="n">whatOp</span> <span class="o">=</span> <span class="n">work</span><span class="o">.</span><span class="n">op</span> - <span class="n">x</span><span class="o">.</span><span class="n">why</span> <span class="o">=</span> <span class="s">'Invalid operation'</span> - <span class="k">raise</span> <span class="n">x</span> + <span class="k">raise</span> <span class="n">InvalidOperation</span><span class="p">(</span><span class="n">work</span><span class="o">.</span><span class="n">op</span><span class="p">,</span> <span class="s">'Invalid operation'</span><span class="p">)</span> <span class="n">log</span> <span class="o">=</span> <span class="n">SharedStruct</span><span class="p">()</span> <span class="n">log</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">logid</span> @@ -272,6 +266,12 @@ h2:hover > .headerlink, h3:hover > .head <span class="c"># You could do one of these for a multithreaded server</span> <span class="c"># server = TServer.TThreadedServer(</span> <span class="c"># processor, transport, tfactory, pfactory)</span> + <span class="c"># server = TServer.TThreadPoolServer(</span> + <span class="c"># processor, transport, tfactory, pfactory)</span> + + <span class="k">print</span><span class="p">(</span><span class="s">'Starting the server...'</span><span class="p">)</span> + <span class="n">server</span><span class="o">.</span><span class="n">serve</span><span class="p">()</span> + <span class="k">print</span><span class="p">(</span><span class="s">'done.'</span><span class="p">)</span> </pre></div> <p class='snippet_footer'>