In
computer programming, a
callback is a piece of
executable code that is passed as an
argument to other code, which is expected to
call back (execute) the argument at some convenient time. The invocation may be immediate as in a
synchronous callback, or it might happen at later time as in an
asynchronous callback. In all cases, the intention is to specify a function or subroutine as an entity that is, depending on the language, more or less similar to a
variable. In simpler terms, a
callback function is a function that is passed as an argument to another function and is invoked after some kind of event.