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

Comparing AnyEvent/lib/AnyEvent/Intro.pod (file contents):
Revision 1.7 by root, Sat May 31 12:55:28 2008 UTC vs.
Revision 1.8 by root, Sat May 31 12:57:43 2008 UTC

9AnyEvent offers a lot of support you can use. 9AnyEvent offers a lot of support you can use.
10 10
11 11
12=head1 What is AnyEvent? 12=head1 What is AnyEvent?
13 13
14Skip this section if you want to see code, now! 14If you don't care for the "why's" and want to see code, skip this section!
15 15
16AnyEvent is first of all just a framework to do event-based 16AnyEvent is first of all just a framework to do event-based
17programming. Typically such frameworks are an all-or-nothing thing: If you 17programming. Typically such frameworks are an all-or-nothing thing: If you
18use one such framework, you can't (easily, or even at all) use another in 18use one such framework, you can't (easily, or even at all) use another in
19the same program. 19the same program.
480 # use a condvar to return results 480 # use a condvar to return results
481 my $cv = AnyEvent->condvar; 481 my $cv = AnyEvent->condvar;
482 482
483 # first, connect to the host 483 # first, connect to the host
484 tcp_connect $host, "finger", sub { 484 tcp_connect $host, "finger", sub {
485 # the callback gets the socket handle - or nothing 485 # the callback receives the socket handle - or nothing
486 my ($fh) = @_ 486 my ($fh) = @_
487 or return $cv->send; 487 or return $cv->send;
488 488
489 # now write the username 489 # now write the username
490 syswrite $fh, "$user\015\012"; 490 syswrite $fh, "$user\015\012";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines