Callback
“callback function - one whose address is supplied for the purpose of being invoked when some anticipated event occurs. Opaque enums (669)” (EMCppSfe 2021)
- Snippet from Wikipedia: Callback (computer programming)
In computer programming, a callback is programming pattern in which a function reference is passed from one context (consumer) to another (provider) such that the provider can call the function. If the function accesses state or functionality of the consumer, then the call is back to the consumer; backwards compared to the normal flow of control in which a consumer calls a provider.
A function that accepts a callback parameter may be designed to call back before returning to its caller. But, more typically, a callback reference is stored by the provider so that it can call the function later; as deferred. If the provider invokes the callback on the same thread as the consumer, then the call is blocking, a.k.a. synchronous. If instead, the provider invokes the callback on a different thread, then the call is non-blocking, a.k.a. asynchronous.
A callback can be likened to leaving instructions with a tailor for what to do when a suit is ready, such as calling a specific phone number or delivering it to a given address. These instructions represent a callback: a function provided in advance to be executed later, often by a different part of the system and not necessarily by the one that received it.
The difference between a general function reference and a callback can be subtle, and some use the terms interchangeably but distinction generally depends on programming intent. If the intent is like the telephone callback – that the original called party communicates back to the original caller – then it's a callback.
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.