… | |
… | |
698 | \=name switch to another node |
698 | \=name switch to another node |
699 | package P switch to package P when evaluating |
699 | package P switch to package P when evaluating |
700 | \$ECHO contains the name of a port that echos everything sent to it |
700 | \$ECHO contains the name of a port that echos everything sent to it |
701 | |
701 | |
702 | EOF |
702 | EOF |
|
|
703 | my $json = JSON::XS->new->pretty->ascii; |
703 | my $pkg = "AnyEvent::MP::Kernel"; |
704 | my $pkg = "AnyEvent::MP::Kernel"; |
704 | my $cv = AE::cv; |
705 | my $cv = AE::cv; |
705 | my $echo = port { |
706 | my $echo = port { |
706 | print "\n ECHO<$AnyEvent::MP::Kernel::SRCNODE> ", JSON::XS::encode_json \@_, "\n$node $pkg> "; |
707 | print "\n ECHO<$AnyEvent::MP::Kernel::SRCNODE> ", $json->encode (\@_), "\n$node $pkg> "; |
707 | }; |
708 | }; |
708 | print "$node $pkg> "; |
709 | print "$node $pkg> "; |
709 | my $t = AE::io *STDIN, 0, sub { |
710 | my $t = AE::io *STDIN, 0, sub { |
710 | chomp (my $line = <STDIN>); |
711 | chomp (my $line = <STDIN>); |
711 | |
712 | |
… | |
… | |
731 | |
732 | |
732 | print "\n $node: $line\n"; |
733 | print "\n $node: $line\n"; |
733 | if (length $err) { |
734 | if (length $err) { |
734 | print " $err @res"; |
735 | print " $err @res"; |
735 | } else { |
736 | } else { |
736 | print " ", JSON::XS::encode_json \@res; |
737 | print " ", $json->encode(\@res); |
737 | } |
738 | } |
738 | printf "\n %0.3fs\n", $time; |
739 | printf "\n %0.3fs\n", $time; |
739 | print "$node $pkg> "; |
740 | print "$node $pkg> "; |
740 | } |
741 | } |
741 | ; |
742 | ; |
… | |
… | |
1015 | delete $profile->{profile}; |
1016 | delete $profile->{profile}; |
1016 | delete $profile->{parent}; |
1017 | delete $profile->{parent}; |
1017 | |
1018 | |
1018 | print JSON::XS->new->pretty->encode ($profile); |
1019 | print JSON::XS->new->pretty->encode ($profile); |
1019 | }, |
1020 | }, |
1020 | |
|
|
1021 | # undocumented |
|
|
1022 | _resolve => sub { |
|
|
1023 | print +(join ",", (AnyEvent::MP::Kernel::_resolve shift @ARGV)->recv), "\n"; |
|
|
1024 | }, |
|
|
1025 | ); |
1021 | ); |
1026 | |
1022 | |
1027 | for my $attr (qw( |
1023 | for my $attr (qw( |
1028 | monitor_timeout connect_interval framing_format auth_offer |
1024 | monitor_timeout connect_interval framing_format auth_offer |
1029 | auth_accept autocork nodelay secure |
1025 | auth_accept autocork nodelay secure |