generic implementation of AsyncResult