Refactored multiplexed i/o to a resource producer.