make callback exec waiting algorithm on close() more clean, less mem usage
add basic usage test case