What is a callback function?
What is callback?
What is a callback function?
otherFunction
) as a parameter, and the callback function is called (or executed) inside the otherFunction
. function action(x, y, callback) {
return callback(x, y);
}
function multiplication(x, y) {
return x * y;
}
function addition(x, y) {
return x + y;
}
alert(action(10, 10, multiplication)); // output: 100
alert(action(10, 10, addition)); // output: 20
In SOA, callback allows the Plugin Modules to access services from the container/environment.
Analogy: Callbacks. Asynchronous. Non-blocking
Real life example for callback