<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>jodal.dev - pykka</title>
    <subtitle>Personal blog of Stein Magnus Jodal</subtitle>
    <link rel="self" type="application/atom+xml" href="https://jodal.dev/tags/pykka/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://jodal.dev"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2019-05-07T00:00:00+00:00</updated>
    <id>https://jodal.dev/tags/pykka/atom.xml</id>
    <entry xml:lang="en">
        <title>Pykka 2.0 released with better ergonomics and performance improvements</title>
        <published>2019-05-07T00:00:00+00:00</published>
        <updated>2019-05-07T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2019/05/07/pykka-2.0/"/>
        <id>https://jodal.dev/2019/05/07/pykka-2.0/</id>
        
        <summary type="html">&lt;p&gt;I’ve finally released &lt;a rel=&quot;external&quot; href=&quot;https://pykka.readthedocs.io/&quot;&gt;Pykka&lt;/a&gt; 2.0, the
first major update to Pykka in almost six years.&lt;/p&gt;
&lt;p&gt;Pykka is a Python implementation of the actor model. The actor model
introduces some simple rules to control the sharing of state and cooperation
between execution units, which makes it easier to build concurrent
applications.&lt;/p&gt;
&lt;p&gt;Pykka 2.0 is a major release because it is backwards incompatible in several
minor ways. However, the backwards incompatible changes should only affect
quite narrow use cases.
Mopidy and its extensions,
which is the largest open source ecosystem I know of that uses Pykka,
runs unmodified on Pykka 2.0.&lt;/p&gt;
&lt;p&gt;In this blog post I’ll go through some of the more important improvements in
2.0.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Pykka packaged in Debian and Ubuntu</title>
        <published>2013-09-03T00:00:00+00:00</published>
        <updated>2013-09-03T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2013/09/03/pykka-packaged-in-debian-and-ubuntu/"/>
        <id>https://jodal.dev/2013/09/03/pykka-packaged-in-debian-and-ubuntu/</id>
        
        <summary type="html">&lt;p&gt;The Python actor library &lt;a rel=&quot;external&quot; href=&quot;http://pykka.readthedocs.io/&quot;&gt;Pykka&lt;/a&gt; is now packaged as
&lt;code&gt;python-pykka&lt;/code&gt; and &lt;code&gt;python3-pykka&lt;/code&gt; in
&lt;a rel=&quot;external&quot; href=&quot;http://packages.debian.org/source/sid/python-pykka&quot;&gt;Debian unstable&lt;/a&gt; and
&lt;a rel=&quot;external&quot; href=&quot;https://launchpad.net/ubuntu/+source/python-pykka&quot;&gt;Ubuntu saucy&lt;/a&gt;, soon to be
Ubuntu 13.10. In a few more days, the packages will be probably be available in
Debian testing as well.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Pykka v1.2.0 with eventlet support and future transformations</title>
        <published>2013-07-18T00:00:00+00:00</published>
        <updated>2013-07-18T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2013/07/18/pykka-v1.2.0/"/>
        <id>https://jodal.dev/2013/07/18/pykka-v1.2.0/</id>
        
        <summary type="html">&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https://pykka.readthedocs.io/&quot;&gt;Pykka&lt;/a&gt; v1.2.0 is now available from PyPI, GitHub, and
&lt;a rel=&quot;external&quot; href=&quot;https://apt.mopidy.com/&quot;&gt;APT&lt;/a&gt;. It’s about half a year since the previous
release, during which no serious bugs have been found.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Traversable attributes in Pykka</title>
        <published>2011-10-06T00:00:00+00:00</published>
        <updated>2011-10-06T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2011/10/06/traversable-attributes-in-pykka/"/>
        <id>https://jodal.dev/2011/10/06/traversable-attributes-in-pykka/</id>
        
        <summary type="html">&lt;p&gt;In &lt;a rel=&quot;external&quot; href=&quot;https://pykka.readthedocs.io/&quot;&gt;Pykka&lt;/a&gt; 0.13–which was released almost two
weeks ago–traversing the attributes of an actor is about 8.3 times faster than
it used to be. To paraphrase Apple: “8.3X faster. That’s amazing!” &lt;em&gt;(Update:
This was written a couple of hours before the news of Jobs’ passing arrived.
May he continue to inspire us.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So, what is “traversable attributes”? Let’s take a few steps back.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Pykka, and porting Pykka to Python 3</title>
        <published>2011-03-29T00:00:00+00:00</published>
        <updated>2011-03-29T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2011/03/29/pykka-and-porting-pykka-to-python-3/"/>
        <id>https://jodal.dev/2011/03/29/pykka-and-porting-pykka-to-python-3/</id>
        
        <summary type="html">&lt;p&gt;This is somewhat of an introduction to &lt;a rel=&quot;external&quot; href=&quot;https://pykka.readthedocs.io/&quot;&gt;Pykka&lt;/a&gt;,
a Python library implementing the actor model, which I’ve been working on now
and then since November. And it’s still just 300 lines of code!&lt;/p&gt;
&lt;p&gt;The goal of the actor model is to make it easier to develop concurrent programs
by removing all shared state and use messaging for all communication. Removing
shared state and doing lots of messaging doesn’t make anything easier by
itself, but it avoids common problems in concurrent programs like proper lock
usage and data corruption (due to the absence of proper lock usage). Also, I
believe the actor model makes it easier to reason about concurrent programs,
which is a nice property since software development often feels like 10%
development and 91% debugging.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>multiprocessing.Connection is not free</title>
        <published>2011-03-20T00:00:00+00:00</published>
        <updated>2011-03-20T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2011/03/20/multiprocessing-connection-is-not-free/"/>
        <id>https://jodal.dev/2011/03/20/multiprocessing-connection-is-not-free/</id>
        
        <summary type="html">&lt;p&gt;I’ve
&lt;a href=&quot;https://jodal.dev/2011/03/06/pickling-multiprocessing-connection-objects/&quot;&gt;previously written&lt;/a&gt;
about how to wrap &lt;code&gt;multiprocessing.Connection&lt;/code&gt; objects in a class that makes
&lt;code&gt;Connection&lt;/code&gt; objects picklable, and thus transferable over another
&lt;code&gt;Connection&lt;/code&gt;. That approach is still valid, but don’t use it–or &lt;code&gt;Connection&lt;/code&gt;
objects at all–for lots of use-once-and-throw-away connections.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Traits in Python using multiple inheritance</title>
        <published>2011-03-15T00:00:00+00:00</published>
        <updated>2011-03-15T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2011/03/15/traits-in-python-using-multiple-inheritance/"/>
        <id>https://jodal.dev/2011/03/15/traits-in-python-using-multiple-inheritance/</id>
        
        <summary type="html">&lt;p&gt;As you probably know, if a class needs to handle two mostly unrelated concerns, the
class should probably be split into two. This way, your will achieve
&lt;a rel=&quot;external&quot; href=&quot;http://en.wikipedia.org/wiki/Cohesion_(computer_science)&quot;&gt;higher cohesion&lt;/a&gt; in your
code, which is generally considered a good thing. Though, there are times where
you need to address two mostly unrelated concerns in a single class.&lt;/p&gt;
&lt;p&gt;The Scala programming language has a concept they call
&lt;a rel=&quot;external&quot; href=&quot;http://www.scala-lang.org/node/126&quot;&gt;traits&lt;/a&gt;. Scala traits can be compared to
Java interfaces, except that Scala traits may be partially or fully
implemented, like abstract classes. As with Java interfaces, you can &lt;em&gt;mixin&lt;/em&gt;
multiple traits in a class. If any of the traits has colliding method
signatures, the last trait mixed in overrides the earlier ones. Just as with
regular inheritance and interfaces, the class &lt;em&gt;must&lt;/em&gt; implement any methods that
has not been implemented by the traits, and &lt;em&gt;may&lt;/em&gt; override any methods that
already has been implemented.&lt;/p&gt;</summary>
        
    </entry>
    <entry xml:lang="en">
        <title>Pickling multiprocessing Connection objects</title>
        <published>2011-03-06T00:00:00+00:00</published>
        <updated>2011-03-06T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jodal.dev/2011/03/06/pickling-multiprocessing-connection-objects/"/>
        <id>https://jodal.dev/2011/03/06/pickling-multiprocessing-connection-objects/</id>
        
        <summary type="html">&lt;p&gt;For safe message-based communication between threads and processes in Python, I
tend to use
&lt;a rel=&quot;external&quot; href=&quot;http://docs.python.org/library/multiprocessing.html&quot;&gt;multiprocessing&lt;/a&gt;’s
&lt;code&gt;Queue&lt;/code&gt; and &lt;code&gt;Pipe&lt;/code&gt;. A pattern often seen is using a queue for sending messages
from multiple producers to a single consumer.&lt;/p&gt;
&lt;p&gt;When a producer wants a response to its message, I create a &lt;code&gt;Pipe&lt;/code&gt; and
piggy-back one end of the &lt;code&gt;Pipe&lt;/code&gt; (a &lt;code&gt;Connection&lt;/code&gt; object) to the message. I use
Python dicts as messages, and use the string “reply_to” as the dictionary key
for the connection objects.&lt;/p&gt;
&lt;p&gt;When the queue consumer processes a message, it doesn’t know who the sender is
or how to reach him. Though, if the message has an attached &lt;code&gt;Connection&lt;/code&gt;
object, the consumer can–almost magically–respond to the sender, across
thread and process boundaries.&lt;/p&gt;
&lt;p&gt;All good? Nope.&lt;/p&gt;</summary>
        
    </entry>
</feed>
