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

Comparing AnyEvent-MP/MP/Global.pm (file contents):
Revision 1.6 by root, Mon Aug 17 03:33:18 2009 UTC vs.
Revision 1.7 by root, Mon Aug 17 03:50:28 2009 UTC

58 my ($noderef, $lreg) = @_; 58 my ($noderef, $lreg) = @_;
59 59
60 while (my ($k, $v) = each %$lreg) { 60 while (my ($k, $v) = each %$lreg) {
61 push @{ $greg{$k} }, @$v; 61 push @{ $greg{$k} }, @$v;
62 } 62 }
63}
64
65=item $ports = find $group
66
67Returns all the ports currently registered to the given group (as
68read-only array reference). When the group has no registered members,
69return C<undef>.
70
71=cut
72
73sub find($) {
74 @{ $greg{$_[0]} }
75 ? $greg{$_[0]}
76 : undef
63} 77}
64 78
65=item $guard = register $port, $group 79=item $guard = register $port, $group
66 80
67Register the given (local!) port in the named global group C<$group>. 81Register the given (local!) port in the named global group C<$group>.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines