diff options
author | Matias Linares <matiaslina@gmail.com> | 2018-10-14 18:29:06 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@gmail.com> | 2018-10-14 18:29:06 -0300 |
commit | 3d6d5a4828e602837886358918e324f34e37b962 (patch) | |
tree | adde3b6f88828da5f1ecdb0e98596868a54e4e86 /examples/run.p6 | |
parent | 47aaf852798acb30f32f3e3ae7ca0fe28e9ac18e (diff) | |
parent | 66c31dda1500b54fd284b82478019e9da6a7e9d1 (diff) | |
download | perl6-matrix-client-3d6d5a4828e602837886358918e324f34e37b962.tar.gz |
Merge branch 'master' of ssh://deprecated.org:22333/var/www/cgit/perl6-matrix-client
Diffstat (limited to 'examples/run.p6')
-rw-r--r-- | examples/run.p6 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/run.p6 b/examples/run.p6 new file mode 100644 index 0000000..f78df16 --- /dev/null +++ b/examples/run.p6 @@ -0,0 +1,21 @@ +#!/usr/bin/env perl6 +use v6; +use lib <lib>; +use Matrix::Client; + +sub MAIN(Str:D $username, Str:D $password, :$home-server = "https://matrix.deprecated.org") { + my Matrix::Client $client .= new: :$home-server; + $client.login($username, $password); + + my $sup = $client.run(:sleep<5>); + + signal(SIGINT).tap({ + say "Bye"; + $client.logout; + exit 0; + }); + + react whenever $sup -> $ev { + say $ev; + } +} |