… | |
… | |
100 | |
100 | |
101 | $self->{transport} = $transport; |
101 | $self->{transport} = $transport; |
102 | |
102 | |
103 | my $transport_send = $transport->can ("send"); |
103 | my $transport_send = $transport->can ("send"); |
104 | |
104 | |
|
|
105 | AnyEvent::MP::Kernel::_inject_nodeevent ($self, 1); |
|
|
106 | |
105 | $self->{send} = sub { |
107 | $self->{send} = sub { |
106 | $transport_send->($transport, $_[0]); |
108 | $transport_send->($transport, $_[0]); |
107 | }; |
109 | }; |
108 | |
|
|
109 | AnyEvent::MP::Kernel::_inject_nodeevent ($self, 1); |
|
|
110 | |
110 | |
111 | $transport->send ($_) |
111 | $transport->send ($_) |
112 | for @{ delete $self->{queue} || [] }; |
112 | for @{ delete $self->{queue} || [] }; |
113 | } |
113 | } |
114 | |
114 | |
… | |
… | |
263 | |
263 | |
264 | # we _always_ delay kil's, to avoid calling mon callbacks |
264 | # we _always_ delay kil's, to avoid calling mon callbacks |
265 | # from anything but the event loop context. |
265 | # from anything but the event loop context. |
266 | $DELAY = 1; |
266 | $DELAY = 1; |
267 | push @DELAY, $delay_cb; |
267 | push @DELAY, $delay_cb; |
|
|
268 | $DELAY_W ||= AE::timer 0, 0, \&_send_delayed; |
268 | } |
269 | } |
269 | |
270 | |
270 | sub monitor { |
271 | sub monitor { |
271 | my ($self, $portid, $cb) = @_; |
272 | my ($self, $portid, $cb) = @_; |
272 | |
273 | |