Created
November 23, 2015 18:27
-
-
Save zoffixznet/0975882676a427bcb35d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my $chan = '#perl6'; | |
await IO::Socket::Async.connect('irc.freenode.net',6667).then( -> $p { | |
my $sock = $p.result; | |
$sock.print("NICK P6\nUSER P6 Perl6 work :Perl6 Perl6\nJOIN $chan\n"); | |
react { | |
whenever $sock.chars-supply() -> $v is copy { | |
$v.say; | |
if ( $v ~~ /':End of NAMES list'/ ) { | |
Supply.interval(5).tap({ | |
$sock.print: ":P6!P6\@work PRIVMSG $chan :Now is {now}\n"; | |
say now; | |
}); | |
} | |
} | |
} | |
say "################CLOSING CONNECTION###################"; | |
$sock.close; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment