event driven programming for io