December 2013
Intermediate to advanced
256 pages
6h 56m
English
Pretty much any system that requires a low-latency response to asynchronous events uses some form of callbacks, observers, or notifiers. They can be found in user interface toolkits, in which they are often called event listeners, and distributed systems. Callbacks are a generic mechanism allowing you to supply code that the system invokes when certain well-known events happen. They have a variety of forms, some making creative use of language-specific features. Languages like C, Perl, JavaScript, and others with a procedural or functional flavor use function pointers (Listing 12-6) or function references (Listing 12-7). Object-oriented languages often implement callbacks through implementations ...
Read now
Unlock full access