New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide API to stop crawljax #270

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

Comments

Projects
None yet
3 participants
@daisy1754
Contributor

daisy1754 commented Jun 7, 2013

// 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();

@ghost ghost assigned alexnederlof Jun 7, 2013

@alexnederlof

This comment has been minimized.

Show comment
Hide comment
@alexnederlof

alexnederlof Jun 7, 2013

Member

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

Member

alexnederlof commented Jun 7, 2013

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

@thc202

This comment has been minimized.

Show comment
Hide comment
@thc202

thc202 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.

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