In my project, the action of my Grails controller is creating a new thread and calling a class form src/groovy folder each time this action is executed. I need to pass the value from this action to the new thread being created. How can I achieve this?
Update: I am implementing crawler4j in my project.
My controller code is as follows: Thanks in advance.
class ResourceController{
def crawl(Integer max) {
String crawlStorageFolder = ".crawler4j";
String website = "www.google.com";
controller.startNonBlocking(BasicCrawler.class, numberOfCrawlers); //this line after a series of background tasks calls the BasicCrawler class located in src/groovy.
Thread.sleep(30 * 1000);
}
The crawler4j starts a new thread when it calls the BasicCrawler class.
The BasicCrawler class has a visit function. I need to pass value of website from ResourceController to the visit function.