Sobes.tech
Junior — Senior

Simultaneous data retrieval from multiple web resources

livecode

Task condition

It is necessary to write a function that will load the contents of several web pages in parallel, using a fixed pool of workers.

Requirements:

  • Create workersCount workers (goroutines).
  • Each worker reads a URL from the inputUrls channel and downloads the page using the DownloadSiteContent function.
  • The obtained results are placed into a thread-safe shared map.
  • Upon receiving a cancellation signal from the context, all workers should terminate correctly.