6 our $VERSION = '0.001001'; # 0.1.1
8 our ($loop, $did_upgrade);
10 sub loop { $loop ||= Tak::Loop->new }
13 return if $did_upgrade;
14 require IO::Async::Loop;
15 my $new_loop = IO::Async::Loop->new;
16 $loop->pass_watches_to($new_loop) if $loop;
22 my ($class, $done) = @_;
24 $class->loop->loop_once until $_[1];
28 my ($class, @requests) = @_;
29 @requests = grep !$_->is_done, @requests;
30 return unless @requests;
31 my %req = map +("$_" => "$_"), @requests;
34 my $orig = $_->{on_result};
36 ($_ => sub { delete $req{$tag}; $orig->(@_); $done = 1 unless keys %req; })
38 my $call = sub { $class->loop_until($done) };
42 $call = sub { local $req->{on_result} = $on_r{$req}; $inner->() };
52 Tak - Multi host remote control over ssh
56 bin/tak -h user1@host1 -h user2@host2 exec cat /etc/hostname
62 package Tak::MyScript;
65 use Tak::ObjectClient;
67 sub each_get_homedir {
68 my ($self, $remote) = @_;
69 my $oc = Tak::ObjectClient->new(remote => $remote);
70 my $home = $oc->new_object('Path::Class::Dir')->absolute->stringify;
72 $remote->host.': '.$home."\n"
80 tak -h something get-homedir
82 =head1 WHERE'S THE REST?
84 A drink leaked in my bag on the way back from LPW. You'll get more once I
85 get my laptop's drive into an enclosure and decant the slides.
89 mst - Matt S. Trout (cpan:MSTROUT) <mst@shadowcat.co.uk>
93 None required yet. Maybe this module is perfect (hahahahaha ...).
97 Copyright (c) 2011 the strictures L</AUTHOR> and L</CONTRIBUTORS>
102 This library is free software and may be distributed under the same terms