protected function doClear($queue, $state)
    {
        try {
            while ($item = $this->pheanstalk->{'peek'.$state}($queue)) {
                $this->pheanstalk->delete($item);
            }
        } catch (ServerException $e) {
        }

        return true;
    }