Implementing a "Thread Callback" in Java
here an example of what I want to do.

2 thread, t_query and t_receive, like these:

t_query{

while(true){

//Do something

Call_external_service(parameters, t_receive);
}

}

t_receive{

while(true){

receive_data_from_external_service();

//Do something with the data

}

the external service is a website and I use it's api to interrogate it (ex Bing.com)
}
Implementing a "Thread Callback" in Java
===

here an example of what I want to do.

2 thread, t_query and t_receive, like these:

t_query{

while(true){

//Do something

Call_external_service(parameters, t_receive);
}

}

t_receive{

while(true){

receive_data_from_external_service();

//Do something with the data

}

the external service is a website and I use it's api to interrogate it (ex Bing.com)
}