public function run()
    {
        $this->addPending();
        $this->ran = true;

        while (count($this->inProcess) !== 0) {

            $this->monitorPending();
        }

        // Clear the references for callbacks.
        $this->onSuccess = null;
        $this->onError = null;
    }