Callback Function
Image a senario, you have several threads executed at the same time, how can you know some threads are already finished? Maybe you want to execuate a thread after another thread, then how can you control the flow? Here, we can use callback functions.
A callback function is a function passed into another function as an argument. The purpose of it is to inform a class Sync/Async if some work in other class is down.
In java, we can implement calbaks by interface. Here is the steps:
Continue reading