From: Matt S Trout Date: Sun, 6 Nov 2011 12:44:25 +0000 (+0000) Subject: remove last vestiges of previous layout X-Git-Tag: v0.001001~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e4cfeeb95265cae3c02067a647b22bf3d4f0de0b;p=scpubgit%2FTak.git remove last vestiges of previous layout --- diff --git a/lib/Tak/Remote.pm b/lib/Tak/Remote.pm deleted file mode 100644 index 821de86..0000000 --- a/lib/Tak/Remote.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Tak::Remote; - -use Moo; - -has router => (is => 'ro', required => 1); - -has name => (is => 'ro', required => 1); - -sub blocking_request { - my ($self, @payload) = @_; - my ($done, @result); - my $cb = sub { my ($self, $tag, @r) = @_; @result = @r; $done = 1; }; - $self->router->send_request($self, $cb, $self->name, @payload); - $self->router->run_until($done); - return @result; -} - -1; diff --git a/lib/Tak/World.pm b/lib/Tak/World.pm deleted file mode 100644 index 83985e5..0000000 --- a/lib/Tak/World.pm +++ /dev/null @@ -1,45 +0,0 @@ -package Tak::World; - -use Tak::JSONChannel; -use Tak::ServiceManager; -use Tak::ModuleLoader; -use Tak::Router; -use Tak::Remote; - -use Moo; - -has channel_args => (is => 'ro', required => 1); - -sub new_from_stdio { - open my $stdin, '<&', \*STDIN; - open my $stdout, '>&', \*STDOUT; - shift->new(channel_args => { read_fh => $stdin, write_fh => $stdout }); -} - -has router => (is => 'lazy'); - -sub _build_router { - my ($self) = @_; - my $channel = Tak::JSONChannel->new($self->channel_args); - - my $router = Tak::Router->new( - channel => $channel - ); - - my $remote = Tak::Remote->new( - router => $router, - name => 'module_sender' - ); - - my $loader = Tak::ModuleLoader->new( - remote => $remote - ); - - push @INC, $loader->inc_callback; - - return $router; -} - -sub run { shift->router->run } - -1; diff --git a/lib/Tak/WorldHandle.pm b/lib/Tak/WorldHandle.pm deleted file mode 100644 index 8a2a187..0000000 --- a/lib/Tak/WorldHandle.pm +++ /dev/null @@ -1,59 +0,0 @@ -package Tak::WorldHandle; - -use IPC::Open2 (); -use Tak::Router; -use Tak::JSONChannel; -use Tak::ModuleSender; -use Tak::Remote; -use IO::All; -use Moo; - -sub Tak::WorldHandle::_local::open2 { - shift; - my $pid = IPC::Open2::open2(my $out, my $in, @_) - or die "Couldn't open2 child: $!"; - return ($in, $out, $pid); -} - -has connection => (is => 'ro', required => 1); - -sub new_local { - shift->new(connection => bless({}, 'Tak::WorldHandle::_local')) -} - -sub new_remote { - my ($class, $target) = @_; - $class->new(connection => do { - require Net::OpenSSH; - Net::OpenSSH->new($target); - }); -} - -has router => (is => 'lazy'); - -sub _build_router { - my ($self) = @_; - - my ($stdin, $stdout) = $self->connection->open2('perl -'); - - $stdin->print(io('maint/mk-fat |')->all, "__END__\n"); - - my $channel = Tak::JSONChannel->new( - read_fh => $stdout, write_fh => $stdin - ); - - my $router = Tak::Router->new( - channel => $channel - ); - - $router->register(module_sender => Tak::ModuleSender->new); - - return $router; -} - -sub remote_for { - my ($self, $name) = @_; - Tak::Remote->new(router => $self->router, name => $name); -} - -1;