title: Python reactive KafkaProducer not working on Threadpool
body: <p>I have the following python script. When I execute it, no messages are being sent to Kafka. If the <code>.subscribe_on(pool_scheduler) \</code> line is not used, All my messages are sent to Kafka And I'm able to consume from <code>mytopic</code> in another script.</p>
  
  <pre><code>import multiprocessing
  import json
  from rx import Observable, Observer
  from rx.concurrency import ThreadPoolScheduler
  from kafka import KafkaProducer
  
  class KafkaObserver(Observer):
      def __init__(self, host, port, topic):
          self.host = host
          self.port = port
          self.kafka_producer = KafkaProducer(
                      bootstrap_servers='{}:{}'.format(host, port),
                      value_serializer=lambda m: json.dumps(m).encode('utf-8'))
          self.topic = topic
  
      def on_next(self, value):
          print("Write point to Kafka: {0}".format(value))
          self.kafka_producer.send(self.topic, value=value)
  
      def on_completed(self):
          print("KafkaObserver completed!")
  
      def on_error(self, error):
          print("Error occured in KafkaObserver: {0}".format(error))
  
  
  
  if __name__ == '__main__':
      kafkaobserver = KafkaObserver(
                  'localhost',
                  9092,
                  'mytopic'
                  )
      inputdata = [.....] // list of data to process
      optimal_thread_count = multiprocessing.cpu_count()
      pool_scheduler = ThreadPoolScheduler(optimal_thread_count)
      kafka_obs = Observable.from_(inputdata) \
                            .subscribe_on(pool_scheduler) \
                            .subscribe(kafkaobserver)
  </code></pre>
  
  <p>I created some other Observers, to write to a database, and they are sending all the data the datastore, with or without the ThreadPoolScheduler.</p>