… | |
… | |
375 | register_write_type netstring => sub { |
375 | register_write_type netstring => sub { |
376 | my ($self, $string) = @_; |
376 | my ($self, $string) = @_; |
377 | |
377 | |
378 | sprintf "%d:%s,", (length $string), $string |
378 | sprintf "%d:%s,", (length $string), $string |
379 | }; |
379 | }; |
|
|
380 | |
|
|
381 | =item json => $array_or_hashref |
380 | |
382 | |
381 | =item AnyEvent::Handle::register_write_type type => $coderef->($self, @args) |
383 | =item AnyEvent::Handle::register_write_type type => $coderef->($self, @args) |
382 | |
384 | |
383 | This function (not method) lets you add your own types to C<push_write>. |
385 | This function (not method) lets you add your own types to C<push_write>. |
384 | Whenever the given C<type> is used, C<push_write> will invoke the code |
386 | Whenever the given C<type> is used, C<push_write> will invoke the code |