event manager,spend a whole day at this gist, i think it's nearly perfect.

Signed-off-by: overblued <ace.jby@gmail.com>