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

Comparing AnyEvent-MP/MP/Node.pm (file contents):
Revision 1.6 by root, Mon Aug 3 21:35:03 2009 UTC vs.
Revision 1.7 by root, Tue Aug 4 14:10:51 2009 UTC

116 $self->{queue} = [$msg]; 116 $self->{queue} = [$msg];
117 $self->connect; 117 $self->connect;
118 } 118 }
119} 119}
120 120
121sub kill {
122 my ($self, $port, @reason) = @_;
123
124 $self->send (["", kil => $port, @reason]);
125
126# delete $AnyEvent::MP::Base::PORT{$port};
127
128# my $mon = delete $AnyEvent::MP::Base::LMON{$port}
129# or return;
130
131# $_->(@reason) for values %$mon;
132}
133
121sub monitor { 134sub monitor {
122 my ($self, $portid, $cb) = @_; 135 my ($self, $portid, $cb) = @_;
123 136
124 return $cb->() 137 return $cb->()
125 if $self->{failed}; 138 if $self->{failed};
252sub send { 265sub send {
253 local $AnyEvent::MP::Base::SRCNODE = $_[0]; 266 local $AnyEvent::MP::Base::SRCNODE = $_[0];
254 AnyEvent::MP::Base::_inject (@{ $_[1] }); 267 AnyEvent::MP::Base::_inject (@{ $_[1] });
255} 268}
256 269
270sub kill {
271 my ($self, $port, @reason) = @_;
272
273 delete $AnyEvent::MP::Base::PORT{$port};
274
275 my $mon = delete $AnyEvent::MP::Base::LMON{$port}
276 or return;
277
278 $_->(@reason) for values %$mon;
279}
280
257sub monitor { 281sub monitor {
258 my ($self, $portid, $cb) = @_; 282 my ($self, $portid, $cb) = @_;
259 283
260 return $cb->() 284 return $cb->()
261 unless exists $AnyEvent::MP::Base::PORT{$portid}; 285 unless exists $AnyEvent::MP::Base::PORT{$portid};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines