protected function createRejectFunction($reject)
    {
        $this->reject = function($reason) use (&$reject) {
            $cancelQueue = $this->cancellationQueue;
            $cancelQueue();
            return isset($reject) ? $reject($reason) : null;
        };
    }