My stack is spring-boot
and myBatis
.
I am going to execute some piece of code asynchronously, more exactly:
@RestController
class Controller
{
@PutMapping("/endpoint")
Response foo ()
{
doSomeStuffAsynchronously(); //execute in new thread
return new Response(); // immediately
}
}
How should I do it ?
Edit
I don't need a callback, however it will be nice to see how to do it.
Learn to use interfaces
I know what is interface, however I can't see how it helps. Can you help me, please ?