diff options
Diffstat (limited to 'examples/run.raku')
-rw-r--r-- | examples/run.raku | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/run.raku b/examples/run.raku new file mode 100644 index 0000000..af1b188 --- /dev/null +++ b/examples/run.raku @@ -0,0 +1,21 @@ +#!/usr/bin/env raku +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; + } +} |