Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:21:08+00:00 2026-06-01T20:21:08+00:00

I have a web-crawler where the basic layout is a manager that runs agents

  • 0

I have a web-crawler where the basic layout is a manager that runs agents that open connection, fetch the content and insert it in a database.

Each one of these agents run in a separate thread in a loop until the user send a stop signal. These agents get the tasks from the manager agent.

The problem is if an exception occurs in a agent, it can’t be throwed to the interface (unless I use some observer to signal that an exception occurred).

I’m thinking that this design is wrong and the correct is create a finite task and putting they in the Executor (create a task for each URL to open connection, fetching content or insert into database).

I’m right that my current design is wrong and must change the layout? What is the right layout to use with multi threading where different agents do different parts of the job?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:21:08+00:00Added an answer on June 1, 2026 at 8:21 pm

    Yes, I think you should be using the Executors. If you submit Callable classes, you can throw from your spider agents and examine the returned Future which causes the exception to be thrown to the job submitter so it can be logged or displayed to your UI.

    ExecutorService pool = Executors.newFixedThreadPool(10);
    Future<Void> future = pool.submit(new Callable<Void>() {
        public Void call() throws Exception {
           // your agent code goes here
           // this can throw an exception in this block which will be re-thrown below
           return null;
        }
    });
    ...
    try {
       // then the exception will be thrown here for you to catch and log
       future.get();
    } catch (ExecutionException e) {
       // log the e.getCause() here
    }
    ...
    pool.shutdown();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented a web crawler that crawls and retrieves content from .edu TLD.
I have a very basic web crawler. The database table which stores the links
I have a simple web crawler that starts at root (given url) downloads the
So, here's my question: I have a crawler that goes and downloads web pages
In a web-crawler of mine, I have a class that keeps track of urls
I have a crawler that downloads webpages, scrapes specific content and then stores that
I have following situation: String a = A Web crawler is a computer program
I just downloaded Scrapy (web crawler) on Windows 32 and have just created a
I have a MyISAM table with ~50'000'000 records (tasks for web crawler): CREATE TABLE
I have a very simple webapp that runs within HTML5's Canvas that doesn't have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.