final function wrap($functionResult) {
        try {
            if($functionResult instanceof \Closure) {
                $functionResult = $functionResult();
            }
            
            if($functionResult instanceof \Throwable) {
                return $this->wrapUp(null, $functionResult);
            } elseif(!($functionResult instanceof \React\Promise\PromiseInterface)) {
                return $this->wrapUp($functionResult, null);
            }
            
            $functionResult->done(function ($val) {
                $this->wrapUp($val, null);
            }, function ($val) {
                $this->wrapUp(null, $val);
            });
        } catch (\Throwable $e) {
            $this->wrapUp(null, $e);
        }
    }