title: Integrate reactive extensions and twisted, basic example?
body: <p>I'm looking for a very basic example of how to use reactive extensions (<a href="https://github.com/ReactiveX/RxPY" rel="nofollow">RxPY</a>) and Twisted.  Here's a minimal hello application that uses Twisted to stream messages.</p>
  
  <pre><code>def hello():
      print 'Hello from the reactor loop!'
      print 'Lately I feel like I\'m stuck in a rut.'
  
  from twisted.internet import reactor
  
  reactor.callWhenRunning(hello)
  
  print 'Starting the reactor.'
  reactor.run()
  </code></pre>
  
  <p>I'd like to use the RxPY library to hook into these streams (they don't have to print out to the screen if that makes it easier), and do canonical operations like map, filter etc...</p>
  
  <p>All of the examples of RxPY I can find either generate their own streams, for example from an iterable, the following code streams integers 0-9:</p>
  
  <pre><code>xs = Observable.from_(range(10))
  xs.map(
      lambda x: x * 2
        ).subscribe(print)
  </code></pre>
  
  <p>Or are included in more complex example (like subclassing WebSocket Handler).  Any idea how I can intercept the print messages?  EG, generate a stream of observables from the Twisted reactor?</p>