1

Suppose we have the following method.

    public Object foo() {
    ...
    ...
    ...
    
    bar();
    
    
    return o;
}

And in this method there is a method call which sends data to the database. But the saving or processing can take a lot of time.

What are the possibilities that I do not have to wait for the method bar() to be processed? Well I want the saving from method bar() to run in the background and I want to be able to leave the methde foo() before bar() is finished.

Thanks.

Hubi
  • 852
  • 1
  • 8
  • 24
  • Your question is tagged with the solution: multithreading. So, start a new thread and do it there. – Michael Jul 28 '20 at 13:07

0 Answers0