postpone adapter start until Record is built
rework main wait loop
restore sleep_until_next_second
make ci hound happy
refactor listener
Merge pull request #233 from guard/rework_main_loop

rework main wait loop