* Add custom license header style in order to comply with Google's Checkstyle format * Update license headers to comply with Google's Checkstyle format
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | ||||
---|---|---|---|---|---|---|---|---|---|
pattern | Callback | callback | /patterns/callback/ | Other |
|
Intent
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.
Applicability
Use the Callback pattern when
- when some arbitrary synchronous or asynchronous action must be performed after execution of some defined activity.
Real world examples
- CyclicBarrier constructor can accept callback that will be triggered every time when barrier is tripped.