Close #4 Add event-driven support