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