public Spider setScheduler(Scheduler updateScheduler) {
        checkIfRunning();
        Scheduler oldScheduler = scheduler.getScheduler();
        scheduler.setScheduler(updateScheduler);
        if (oldScheduler != null) {
            Request request;
            while ((request = oldScheduler.poll(this)) != null) {
                this.scheduler.push(request, this);
            }
        }
        return this;
    }
set scheduler for Spider

@param updateScheduler scheduler
@return this
@see Scheduler
@since 0.2.1
webmagic-core/src/main/java/us/codecraft/webmagic/Spider.java