Extract event posting task into own class This is a preparation step for improving the retry logic where thread sleep will be replaced by rescheduling the task. This should make it easier to write tests for the retry logic. Change-Id: Ided1d30f530fbd09cfa48d186e0d7f7ea9ac1cf1