Implement polling mode, fixes #9