New function to allow for custom select statements in programs. The previous blocking version of polling is inneficient when you have mutliple channels feeding into main thread.