<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,8 +4,10 @@ use MooseX::Declare;
 
 use MooseX::Getopt (); # preload the traits
 
+use 5.010;
+
 class FakeGistUpdater with MooseX::Getopt::Dashes {
-	use LWP::Simple qw(get);
+	use AnyEvent::HTTP;
 	use Carp qw(croak);
 	use MooseX::Types::Path::Class qw(File);
 	
@@ -134,8 +136,8 @@ class FakeGistUpdater with MooseX::Getopt::Dashes {
 		$self-&gt;dom-&gt;documentElement-&gt;findnodes(q{//*[contains(concat(' ', @class, ' '), ' fake-gist ')]})-&gt;get_nodelist;
 	}
 
-	method download_gist ($gist) {
-		get(&quot;http://gist.github.com/${gist}.txt&quot;);
+	method gist_uri ($gist) {
+		&quot;http://gist.github.com/${gist}.txt&quot;;
 	}
 
 	method replace_text ($elem, $text) {
@@ -147,9 +149,18 @@ class FakeGistUpdater with MooseX::Getopt::Dashes {
 		my $id = $node-&gt;getAttribute('id');
 
 		my ( $gist_id ) = ( $id =~ /^fake-gist-(.+)$/ );
-		my $gist_text = $self-&gt;download_gist($gist_id);
 
-		$self-&gt;replace_text($node, $gist_text);
+		my $v = AnyEvent-&gt;condvar;
+
+		say &quot;Fetching gist $gist_id&quot;;
+
+		http_get $self-&gt;gist_uri($gist_id), sub {
+			my $gist_text = shift;
+			$self-&gt;replace_text($node, $gist_text);
+			$v-&gt;send($node);
+		};
+
+		return $v;
 	}
 
 	method extract_text ($node) {
@@ -180,27 +191,35 @@ class FakeGistUpdater with MooseX::Getopt::Dashes {
 
 		my %args = $self-&gt;extract_gist_args($node);
 
+		say &quot;Creating new gist&quot;;
+
 		my ( $ok, $link ) = App::Nopaste::Service::Gist-&gt;nopaste(%args);
 
 		croak &quot;Gist creation failed: $link&quot; unless $ok;
 
 		my ( $id ) = ( $link =~ /(\d+)$/ );
 
+		say &quot;Created gist $id&quot;;
+
 		$node-&gt;removeAttribute('lang');
 		$self-&gt;replace_text($node, $args{text}); # for consistency
 		$node-&gt;setAttribute(id =&gt; &quot;fake-gist-$id&quot;);
+
+		my $v = AnyEvent-&gt;condvar;
+		$v-&gt;send($node);
+		return $v;
 	}
 
 	method process_node ($node) {
 		if ( $node-&gt;getAttribute('id') ) {
-			$self-&gt;update_gist( $node );
+			return $self-&gt;update_gist($node);
 		} else {
-			$self-&gt;post_gist($node);
+			return $self-&gt;post_gist($node);
 		}
 	}
 
 	method process_dom {
-		$self-&gt;process_node($_) for $self-&gt;get_fake_gist_nodes;
+		$_-&gt;recv for map { $self-&gt;process_node($_) } $self-&gt;get_fake_gist_nodes;
 	}
 
 	method output_dom {</diff>
      <filename>update.pl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4961603e1c5a866c8a1c71178730eb60bb629392</id>
    </parent>
  </parents>
  <author>
    <name>Yuval Kogman</name>
    <email>nothingmuch@woobling.org</email>
  </author>
  <url>http://github.com/nothingmuch/jquery-gist-upgrade/commit/7540bdb48d31d0497429bb368a1dbda43508646a</url>
  <id>7540bdb48d31d0497429bb368a1dbda43508646a</id>
  <committed-date>2009-06-01T13:13:08-07:00</committed-date>
  <authored-date>2009-06-01T13:13:08-07:00</authored-date>
  <message>use AnyEvent::HTTP for concurrent fetching</message>
  <tree>01287478d2924396998cab7eaca1943b4a8efec3</tree>
  <committer>
    <name>Yuval Kogman</name>
    <email>nothingmuch@woobling.org</email>
  </committer>
</commit>
