Trigger registered functions on state change(enter or exit) for async tasks. Control working in automata manner.