ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent.pm (file contents):
Revision 1.249 by root, Mon Jul 20 06:00:42 2009 UTC vs.
Revision 1.250 by root, Mon Jul 20 07:12:38 2009 UTC

517Condition variables are similar to callbacks, except that you can 517Condition variables are similar to callbacks, except that you can
518optionally wait for them. They can also be called merge points - points 518optionally wait for them. They can also be called merge points - points
519in time where multiple outstanding events have been processed. And yet 519in time where multiple outstanding events have been processed. And yet
520another way to call them is transactions - each condition variable can be 520another way to call them is transactions - each condition variable can be
521used to represent a transaction, which finishes at some point and delivers 521used to represent a transaction, which finishes at some point and delivers
522a result. 522a result. And yet some people know them as "futures" - a promise to
523compute/deliver something that you can wait for.
523 524
524Condition variables are very useful to signal that something has finished, 525Condition variables are very useful to signal that something has finished,
525for example, if you write a module that does asynchronous http requests, 526for example, if you write a module that does asynchronous http requests,
526then a condition variable would be the ideal candidate to signal the 527then a condition variable would be the ideal candidate to signal the
527availability of results. The user can either act when the callback is 528availability of results. The user can either act when the callback is

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines