Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > b9ca70a7484981df9126f0365edf0863 > files > 251

python-pyzmq-2.2.0.1-1mdv2010.1.i586.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Changes in PyZMQ &mdash; PyZMQ v2.2.0.1 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '2.2.0.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/zeromq.ico"/>
    <link rel="top" title="PyZMQ v2.2.0.1 documentation" href="index.html" /> 
  </head>
  <body>

<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="index.html"><img src="_static/logo.png" border="0" alt="PyZMQ Documentation"/></a>
</div>

    <div class="related">
      <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="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="index.html">home</a>|&nbsp;</li>
        <li><a href="search.html">search</a>|&nbsp;</li>
       <li><a href="api/index.html">API</a> &raquo;</li>
 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Changes in PyZMQ</a><ul>
<li><a class="reference internal" href="#id1">2.2.0.1</a><ul>
<li><a class="reference internal" href="#experimental-new-stuff">Experimental New Stuff</a><ul>
<li><a class="reference internal" href="#threadsafe-zmqstream">Threadsafe ZMQStream</a></li>
<li><a class="reference internal" href="#pip-install-pyzmq">pip install pyzmq</a></li>
<li><a class="reference internal" href="#zmq-green">zmq.green</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bugs-fixed">Bugs fixed</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id2">2.2.0</a><ul>
<li><a class="reference internal" href="#name-changes">Name Changes</a></li>
<li><a class="reference internal" href="#other-changes-and-removals">Other Changes and Removals</a></li>
<li><a class="reference internal" href="#new-stuff">New Stuff</a></li>
<li><a class="reference internal" href="#id3">Experimental New Stuff</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id4">2.1.11</a></li>
<li><a class="reference internal" href="#id5">2.1.10</a></li>
<li><a class="reference internal" href="#id6">2.1.9</a></li>
<li><a class="reference internal" href="#id7">2.1.7.1</a></li>
<li><a class="reference internal" href="#id8">2.1.7</a></li>
<li><a class="reference internal" href="#id9">2.1.4</a></li>
</ul>
</li>
</ul>

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/changelog.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="changes-in-pyzmq">
<span id="changelog"></span><h1>Changes in PyZMQ<a class="headerlink" href="#changes-in-pyzmq" title="Permalink to this headline">¶</a></h1>
<p>This is a coarse summary of changes in pyzmq versions.  For a real changelog, consult the
<a class="reference external" href="https://github.com/zeromq/pyzmq/commits">git log</a></p>
<div class="section" id="id1">
<h2>2.2.0.1<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p>This is a tech-preview release, to try out some new features.
It is expected to be short-lived, as there are likely to be issues to iron out,
particularly with the new pip-install support.</p>
<div class="section" id="experimental-new-stuff">
<h3>Experimental New Stuff<a class="headerlink" href="#experimental-new-stuff" title="Permalink to this headline">¶</a></h3>
<p>These features are marked &#8216;experimental&#8217;, which means that their APIs are not set in stone,
and may be removed or changed in incompatible ways in later releases.</p>
<div class="section" id="threadsafe-zmqstream">
<h4>Threadsafe ZMQStream<a class="headerlink" href="#threadsafe-zmqstream" title="Permalink to this headline">¶</a></h4>
<p>With the IOLoop inherited from tornado, there is exactly one method that is threadsafe:
<a class="reference internal" href="api/generated/zmq.eventloop.ioloop.html#zmq.eventloop.ioloop.IOLoop.add_callback" title="zmq.eventloop.ioloop.IOLoop.add_callback"><tt class="xref py py-meth docutils literal"><span class="pre">IOLoop.add_callback()</span></tt></a>.  With this release, we are trying an experimental option
to pass all IOLoop calls via this method, so that ZMQStreams can be used from one thread
while the IOLoop runs in another.  To try out a threadsafe stream:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">stream</span> <span class="o">=</span> <span class="n">ZMQStream</span><span class="p">(</span><span class="n">socket</span><span class="p">,</span> <span class="n">threadsafe</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="pip-install-pyzmq">
<h4>pip install pyzmq<a class="headerlink" href="#pip-install-pyzmq" title="Permalink to this headline">¶</a></h4>
<p>PyZMQ should now be pip installable, even on systems without libzmq.
In these cases, when pyzmq fails to find an appropriate libzmq to link against,
it will try to build libzmq as a Python extension.
This work is derived from <a class="reference external" href="https://github.com/brandon-rhodes/pyzmq-static">pyzmq_static</a>.</p>
<p>To this end, PyZMQ source distributions include the sources for libzmq (2.2.0) and libuuid (2.21),
both used under the LGPL.</p>
</div>
<div class="section" id="zmq-green">
<h4>zmq.green<a class="headerlink" href="#zmq-green" title="Permalink to this headline">¶</a></h4>
<p>The excellent <a class="reference external" href="https://github.com/traviscline/gevent_zeromq">gevent_zeromq</a> socket
subclass which provides <a class="reference external" href="http://www.gevent.org/">gevent</a> compatibility has been merged as
<tt class="xref py py-mod docutils literal"><span class="pre">zmq.green</span></tt>.</p>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="eventloop.html#zmq-green"><em>gevent</em></a></p>
</div>
</div>
</div>
<div class="section" id="bugs-fixed">
<h3>Bugs fixed<a class="headerlink" href="#bugs-fixed" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>TIMEO sockopts are properly included for libzmq-2.2.0</li>
<li>avoid garbage collection of sockets after fork (would cause <tt class="docutils literal"><span class="pre">assert</span> <span class="pre">(mailbox.cpp:79)</span></tt>).</li>
</ul>
</div>
</div>
<div class="section" id="id2">
<h2>2.2.0<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p>Some effort has gone into refining the pyzmq API in this release to make it a model for
other language bindings.  This is principally made in a few renames of objects and methods,
all of which leave the old name for backwards compatibility.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">As of this release, all code outside <tt class="docutils literal"><span class="pre">zmq.core</span></tt> is BSD licensed (where
possible), to allow more permissive use of less-critical code and utilities.</p>
</div>
<div class="section" id="name-changes">
<h3>Name Changes<a class="headerlink" href="#name-changes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>The <tt class="xref py py-class docutils literal"><span class="pre">Message</span></tt> class has been renamed to <tt class="xref py py-class docutils literal"><span class="pre">Frame</span></tt>, to better match other
zmq bindings. The old Message name remains for backwards-compatibility.  Wherever pyzmq
docs say &#8220;Message&#8221;, they should refer to a complete zmq atom of communication (one or
more Frames, connected by ZMQ_SNDMORE). Please report any remaining instances of
Message==MessagePart with an Issue (or better yet a Pull Request).</li>
<li>All <tt class="docutils literal"><span class="pre">foo_unicode</span></tt> methods are now called <tt class="docutils literal"><span class="pre">foo_string</span></tt> (<tt class="docutils literal"><span class="pre">_unicode</span></tt> remains for
backwards compatibility).  This is not only for cross-language consistency, but it makes
more sense in Python 3, where native strings are unicode, and the <tt class="docutils literal"><span class="pre">_unicode</span></tt> suffix
was wedded too much to Python 2.</li>
</ul>
</div>
<div class="section" id="other-changes-and-removals">
<h3>Other Changes and Removals<a class="headerlink" href="#other-changes-and-removals" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">prefix</span></tt> removed as an unused keyword argument from <tt class="xref py py-meth docutils literal"><span class="pre">send_multipart()</span></tt>.</li>
<li>ZMQStream <a class="reference internal" href="api/generated/zmq.eventloop.zmqstream.html#zmq.eventloop.zmqstream.ZMQStream.send" title="zmq.eventloop.zmqstream.ZMQStream.send"><tt class="xref py py-meth docutils literal"><span class="pre">send()</span></tt></a> default has been changed to <cite>copy=True</cite>, so it matches
Socket <tt class="xref py py-meth docutils literal"><span class="pre">send()</span></tt>.</li>
<li>ZMQStream <a class="reference internal" href="api/generated/zmq.eventloop.zmqstream.html#zmq.eventloop.zmqstream.ZMQStream.on_err" title="zmq.eventloop.zmqstream.ZMQStream.on_err"><tt class="xref py py-meth docutils literal"><span class="pre">on_err()</span></tt></a> is deprecated, because it never did anything.</li>
<li>Python 2.5 compatibility has been dropped, and some code has been cleaned up to reflect
no-longer-needed hacks.</li>
<li>Some Cython files in <tt class="xref py py-mod docutils literal"><span class="pre">zmq.core</span></tt> have been split, to reduce the amount of
Cython-compiled code.  Much of the body of these files were pure Python, and thus did
not benefit from the increased compile time.  This change also aims to ease maintaining
feature parity in other projects, such as
<a class="reference external" href="https://github.com/svpcom/pyzmq-ctypes">pyzmq-ctypes</a>.</li>
</ul>
</div>
<div class="section" id="new-stuff">
<h3>New Stuff<a class="headerlink" href="#new-stuff" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt> objects can now set default options when they create a socket. These
are set and accessed as attributes to the context.  Socket options that do not apply to a
socket (e.g. SUBSCRIBE on non-SUB sockets) will simply be ignored.</li>
<li><a class="reference internal" href="api/generated/zmq.eventloop.zmqstream.html#zmq.eventloop.zmqstream.ZMQStream.on_recv_stream" title="zmq.eventloop.zmqstream.ZMQStream.on_recv_stream"><tt class="xref py py-meth docutils literal"><span class="pre">on_recv_stream()</span></tt></a> has been added, which adds the stream itself as a
second argument to the callback, making it easier to use a single callback on multiple
streams.</li>
<li>A <tt class="xref py py-attr docutils literal"><span class="pre">more</span></tt> boolean attribute has been added to the <tt class="xref py py-class docutils literal"><span class="pre">Frame</span></tt> (née
Message) class, so that frames can be identified as terminal without extra queires of
<tt class="xref py py-attr docutils literal"><span class="pre">rcvmore</span></tt>.</li>
</ul>
</div>
<div class="section" id="id3">
<h3>Experimental New Stuff<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p>These features are marked &#8216;experimental&#8217;, which means that their APIs are not
set in stone, and may be removed or changed in incompatible ways in later releases.</p>
<ul class="simple">
<li><tt class="xref py py-mod docutils literal"><span class="pre">zmq.web</span></tt> added for load-balancing requests in a tornado webapp with zeromq.</li>
</ul>
</div>
</div>
<div class="section" id="id4">
<h2>2.1.11<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">remove support for LABEL prefixes.  A major feature of libzmq-3.0, the LABEL
prefix, has been removed from libzmq, prior to the first stable libzmq 3.x release.</p>
<ul class="simple">
<li>The prefix argument to <tt class="xref py py-meth docutils literal"><span class="pre">send_multipart()</span></tt> remains, but it continue to behave in
exactly the same way as it always has on 2.1.x, simply prepending message parts.</li>
<li><tt class="xref py py-meth docutils literal"><span class="pre">recv_multipart()</span></tt> will always return a list, because prefixes are once
again indistinguishable from regular message parts.</li>
</ul>
</li>
<li><p class="first">add <tt class="xref py py-meth docutils literal"><span class="pre">Socket.poll()</span></tt> method, for simple polling of events on a single socket.</p>
</li>
<li><p class="first">no longer require monkeypatching tornado IOLoop.  The <a class="reference internal" href="api/generated/zmq.eventloop.ioloop.html#zmq.eventloop.ioloop.ZMQPoller" title="zmq.eventloop.ioloop.ZMQPoller"><tt class="xref py py-class docutils literal"><span class="pre">ioloop.ZMQPoller</span></tt></a> class
is a poller implementation that matches tornado&#8217;s expectations, and pyzmq sockets can
be used with any tornado application just by specifying the use of this poller.  The
pyzmq IOLoop implementation now only trivially differs from tornado&#8217;s.</p>
<p>It is still recommended to use <a class="reference internal" href="api/generated/zmq.eventloop.ioloop.html#zmq.eventloop.ioloop.install" title="zmq.eventloop.ioloop.install"><tt class="xref py py-func docutils literal"><span class="pre">ioloop.install()</span></tt></a>, which sets <em>both</em> the zmq and
tornado global IOLoop instances to the same object, but it is no longer necessary.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">The most important part of this change is that the <tt class="docutils literal"><span class="pre">IOLoop.READ/WRITE/ERROR</span></tt>
constants now match tornado&#8217;s, rather than being mapped directly to the zmq
<tt class="docutils literal"><span class="pre">POLLIN/OUT/ERR</span></tt>. So applications that used the low-level <tt class="xref py py-meth docutils literal"><span class="pre">IOLoop.add_handler()</span></tt>
code with <tt class="docutils literal"><span class="pre">POLLIN/OUT/ERR</span></tt> directly (used to work, but was incorrect), rather than
using the IOLoop class constants will no longer work. Fixing these to use the IOLoop
constants should be insensitive to the actual value of the constants.</p>
</div>
</li>
</ul>
</div>
<div class="section" id="id5">
<h2>2.1.10<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">Add support for libzmq-3.0 LABEL prefixes:</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">This feature has been removed from libzmq, and thus removed from future pyzmq
as well.</p>
</div>
<ul>
<li><p class="first">send a message with label-prefix with:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">send_multipart</span><span class="p">([</span><span class="n">b</span><span class="s">&#39;msg&#39;</span><span class="p">,</span> <span class="n">b</span><span class="s">&#39;parts&#39;</span><span class="p">],</span> <span class="n">prefix</span><span class="o">=</span><span class="p">[</span><span class="n">b</span><span class="s">&#39;label&#39;</span><span class="p">,</span> <span class="n">b</span><span class="s">&#39;prefix&#39;</span><span class="p">])</span>
</pre></div>
</div>
</li>
<li><p class="first"><tt class="xref py py-meth docutils literal"><span class="pre">recv_multipart()</span></tt> returns a tuple of <tt class="docutils literal"><span class="pre">(prefix,msg)</span></tt> if a label prefix is detected</p>
</li>
<li><p class="first">ZMQStreams and devices also respect the LABEL prefix</p>
</li>
</ul>
</li>
<li><p class="first">add czmq-style close&amp;term as <tt class="xref py py-meth docutils literal"><span class="pre">ctx.destroy()</span></tt>, so that <tt class="xref py py-meth docutils literal"><span class="pre">ctx.term()</span></tt>
remains threadsafe and 1:1 with libzmq.</p>
</li>
<li><p class="first"><tt class="xref py py-meth docutils literal"><span class="pre">Socket.close()</span></tt> takes optional linger option, for setting linger prior
to closing.</p>
</li>
<li><p class="first">add <tt class="xref py py-func docutils literal"><span class="pre">zmq_version_info()</span></tt> and
<a class="reference internal" href="api/generated/zmq.core.version.html#zmq.core.version.pyzmq_version_info" title="zmq.core.version.pyzmq_version_info"><tt class="xref py py-func docutils literal"><span class="pre">pyzmq_version_info()</span></tt></a> for getting libzmq and pyzmq versions as
tuples of numbers. This helps with the fact that version string comparison breaks down
once versions get into double-digits.</p>
</li>
<li><p class="first">ioloop changes merged from upstream <a class="reference external" href="http://www.tornadoweb.org">Tornado</a> 2.1</p>
</li>
</ul>
</div>
<div class="section" id="id6">
<h2>2.1.9<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>added zmq.ssh tools for tunneling socket connections, copied from IPython</li>
<li>Expanded sockopt support to cover changes in libzmq-4.0 dev.</li>
<li>Fixed an issue that prevented <tt class="xref py py-exc docutils literal"><span class="pre">KeyboardInterrupts</span></tt> from being catchable.</li>
<li>Added attribute-access for set/getsockopt.  Setting/Getting attributes of <tt class="xref py py-class docutils literal"><span class="pre">Sockets</span></tt>
with the names of socket options is mapped to calls of set/getsockopt.</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre><span class="n">s</span><span class="o">.</span><span class="n">hwm</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">s</span><span class="o">.</span><span class="n">identity</span> <span class="o">=</span> <span class="n">b</span><span class="s">&#39;whoda&#39;</span>
<span class="n">s</span><span class="o">.</span><span class="n">linger</span>
<span class="c"># -1</span>
</pre></div>
</div>
<ul class="simple">
<li>Terminating a <tt class="xref py py-class docutils literal"><span class="pre">Context</span></tt> closes the sockets it created, matching the behavior in
<a class="reference external" href="http://czmq.zeromq.org/">czmq</a>.</li>
<li><tt class="xref py py-class docutils literal"><span class="pre">ThreadDevices</span></tt> use <tt class="xref py py-meth docutils literal"><span class="pre">Context.instance()</span></tt> to create sockets, so they can use
inproc connections to sockets in other threads.</li>
<li>fixed units error on <tt class="xref py py-func docutils literal"><span class="pre">zmq.select()</span></tt>, where the poll timeout was 1000 times longer
than expected.</li>
<li>Add missing <tt class="docutils literal"><span class="pre">DEALER/ROUTER</span></tt> socket type names (currently aliases, to be replacements for <tt class="docutils literal"><span class="pre">XREP/XREQ</span></tt>).</li>
<li>base libzmq dependency raised to 2.1.4 (first stable release) from 2.1.0.</li>
</ul>
</div>
<div class="section" id="id7">
<h2>2.1.7.1<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>bdist for 64b Windows only.  This fixed a type mismatch on the <tt class="docutils literal"><span class="pre">ZMQ_FD</span></tt> sockopt
that only affected that platform.</li>
</ul>
</div>
<div class="section" id="id8">
<h2>2.1.7<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Added experimental support for libzmq-3.0 API</li>
<li>Add <a class="reference internal" href="api/generated/zmq.eventloop.ioloop.html#zmq.eventloop.ioloop.install" title="zmq.eventloop.ioloop.install"><tt class="xref py py-func docutils literal"><span class="pre">zmq.eventloop.ioloop.install()</span></tt></a> for using pyzmq&#8217;s IOLoop in a tornado
application.</li>
</ul>
</div>
<div class="section" id="id9">
<h2>2.1.4<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>First version with binary distribution support</li>
<li>Added <tt class="xref py py-meth docutils literal"><span class="pre">instance()</span></tt> method for using a single Context throughout an application
without passing references around.</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <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="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="index.html">home</a>|&nbsp;</li>
        <li><a href="search.html">search</a>|&nbsp;</li>
       <li><a href="api/index.html">API</a> &raquo;</li>
 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2010-2011, Brian E. Granger &amp; Min Ragan-Kelley.  
ØMQ logo © iMatix Corportation, used under the Creative Commons Attribution-Share Alike 3.0 License.  
Python logo ™ of the Python Software Foundation, used by Min RK with permission from the Foundation.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>