try to write my own ioloop lib