… | |
… | |
517 | Condition variables are similar to callbacks, except that you can |
517 | Condition variables are similar to callbacks, except that you can |
518 | optionally wait for them. They can also be called merge points - points |
518 | optionally wait for them. They can also be called merge points - points |
519 | in time where multiple outstanding events have been processed. And yet |
519 | in time where multiple outstanding events have been processed. And yet |
520 | another way to call them is transactions - each condition variable can be |
520 | another way to call them is transactions - each condition variable can be |
521 | used to represent a transaction, which finishes at some point and delivers |
521 | used to represent a transaction, which finishes at some point and delivers |
522 | a result. |
522 | a result. And yet some people know them as "futures" - a promise to |
|
|
523 | compute/deliver something that you can wait for. |
523 | |
524 | |
524 | Condition variables are very useful to signal that something has finished, |
525 | Condition variables are very useful to signal that something has finished, |
525 | for example, if you write a module that does asynchronous http requests, |
526 | for example, if you write a module that does asynchronous http requests, |
526 | then a condition variable would be the ideal candidate to signal the |
527 | then a condition variable would be the ideal candidate to signal the |
527 | availability of results. The user can either act when the callback is |
528 | availability of results. The user can either act when the callback is |
… | |
… | |
1066 | |
1067 | |
1067 | BEGIN { AnyEvent::common_sense } |
1068 | BEGIN { AnyEvent::common_sense } |
1068 | |
1069 | |
1069 | use Carp (); |
1070 | use Carp (); |
1070 | |
1071 | |
1071 | our $VERSION = 4.85; |
1072 | our $VERSION = 4.86; |
1072 | our $MODEL; |
1073 | our $MODEL; |
1073 | |
1074 | |
1074 | our $AUTOLOAD; |
1075 | our $AUTOLOAD; |
1075 | our @ISA; |
1076 | our @ISA; |
1076 | |
1077 | |