This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

callback methods

 
rani bedi
Ranch Hand
Posts: 358
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are callback methods?
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A callback provides an asynchronous way of doing something.
If you have a thing that needs to be done, and you don't want the application to sit around waiting for it to be done, then you assign the job to some other class, and when that class has done the request, it sends a callback to you.
For instance, when you create a listener, you are assigning it the job of listening for events. Then you go on and do other stuff. When an event happens, the listener makes a callback to you saying "An event happened", now it is your job to handle the event in your callback method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic