title: Python Twisted. Implement 'socket.io'-like events
body: <p>Can't figure out how to implement custom events inside a Protocol</p>
  
  <p>E.g. server-side</p>
  
  <pre><code>client.on('checkin', function (name) { ... });
  </code></pre>
  
  <p>and client-side</p>
  
  <pre><code>socket.emit('checkin',name);
  </code></pre>
  
  <p>My current thought is to make if condition depending on a data received in <code>dataReceived(self, data)</code> function. A kind of header stored in data.</p>
  
  <p>Any suggestion or docs would be appreciated. Thanks.</p>