Definition of Callback function

What is the common definition of the callback function in the context of software implementation? Could anyone provide one example-based scenario?


A customer visited a store, but found the desired item to be out of stock.

They leave their address and a check with a clerk, instructing the clerk to cash in the check and send the item to the address (registering a callback function).

When the item became available, the clerk performs the instruction (calling the callback function).

a callback or callback function is any reference to executable code that is passed as an argument to another piece of code; that code is expected to call back (execute) the callback function as part of its job. This execution may be immediate as in a synchronous callback , or it might happen at a later point in time as in an asynchronous callback . They are also called blocking and non-blocking .