Provide API to stop crawljax #270

Closed
daisy1754 opened this Issue Jun 7, 2013 · 2 comments

Projects

None yet

3 participants

@daisy1754
Contributor

// I know it has been discussed in mailing list. I'm not an author of that e-mail, below is my use-case.
When I find an invariant violation, I want to stop crawling immediately. I want to do something like this:

        builder.crawlRules().addInvariant(someCriticalInvariant);
        builder.addPlugin(new OnInvariantViolationPlugin() {

            @Override
            public void onInvariantViolation(Invariant invariant, CrawlerContext context) {
                CrawljaxRunner runner = context.getRunner(); // This method doesn't exist
                runner.terminate(); // This method doesn't exist
            }
        });

        CrawljaxRunner crawljax = new CrawljaxRunner(builder.build());
        crawljax.call();
@alexnederlof alexnederlof was assigned Jun 7, 2013
@alexnederlof
Member

No problem. I will try to squeeze this in the 3.1 next week.

@thc202
thc202 commented Jun 10, 2013

I'm the author of the topic in the mailing list.

The new API matches my use case (the PostCrawlingPlugin plug-ins are allowed to run after the call to stop).

Thanks.

@amesbah amesbah closed this in #274 Jun 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment