summaryrefslogtreecommitdiff
path: root/examples/io-async.pl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/io-async.pl')
-rw-r--r--examples/io-async.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/io-async.pl b/examples/io-async.pl
new file mode 100644
index 0000000..7763db1
--- /dev/null
+++ b/examples/io-async.pl
@@ -0,0 +1,9 @@
+use IO::Async::Loop 0.56; # Already has Future support built-in ;)
+
+my $loop = IO::Async::Loop->new;
+
+my $timer = $loop->delay_future( after => 3 );
+print "Awaiting 3 seconds...\n";
+
+$timer->get;
+print "Done\n";