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.48 by root, Mon Apr 14 19:00:23 2008 UTC vs.
Revision 1.49 by root, Mon Apr 14 19:11:15 2008 UTC

642 642
6431. Blocking: 6431. Blocking:
644 644
645 my $data = $fcp->client_get ($url); 645 my $data = $fcp->client_get ($url);
646 646
6472. Blocking, but parallelizing: 6472. Blocking, but running in parallel:
648 648
649 my @datas = map $_->result, 649 my @datas = map $_->result,
650 map $fcp->txn_client_get ($_), 650 map $fcp->txn_client_get ($_),
651 @urls; 651 @urls;
652 652
653Both blocking examples work without the module user having to know 653Both blocking examples work without the module user having to know
654anything about events. 654anything about events.
655 655
6563a. Event-based in a main program, using any support Event module: 6563a. Event-based in a main program, using any supported event module:
657 657
658 use Event; 658 use EV;
659 659
660 $fcp->txn_client_get ($url)->cb (sub { 660 $fcp->txn_client_get ($url)->cb (sub {
661 my $txn = shift; 661 my $txn = shift;
662 my $data = $txn->result; 662 my $data = $txn->result;
663 ... 663 ...
664 }); 664 });
665 665
666 Event::loop; 666 EV::loop;
667 667
6683b. The module user could use AnyEvent, too: 6683b. The module user could use AnyEvent, too:
669 669
670 use AnyEvent; 670 use AnyEvent;
671 671
678 678
679 $quit->wait; 679 $quit->wait;
680 680
681=head1 SEE ALSO 681=head1 SEE ALSO
682 682
683Event modules: L<Coro::Event>, L<Coro>, L<Event>, L<Glib::Event>, L<Glib>. 683Event modules: L<Coro::EV>, L<EV>, L<EV::Glib>, L<Glib::EV>,
684L<Coro::Event>, L<Event>, L<Glib::Event>, L<Glib>, L<Coro>, L<Tk>.
684 685
685Implementations: L<AnyEvent::Impl::Coro>, L<AnyEvent::Impl::Event>, L<AnyEvent::Impl::Glib>, L<AnyEvent::Impl::Tk>. 686Implementations: L<AnyEvent::Impl::CoroEV>, L<AnyEvent::Impl::EV>,
687L<AnyEvent::Impl::CoroEvent>, L<AnyEvent::Impl::Event>,
688L<AnyEvent::Impl::Glib>, L<AnyEvent::Impl::Tk>, L<AnyEvent::Impl::Perl>.
686 689
687Nontrivial usage example: L<Net::FCP>. 690Nontrivial usage examples: L<Net::FCP>, L<Net::XMPP2>.
688 691
689=head1 692=head1
690 693
691=cut 694=cut
692 695

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines