-
-
Save kanatohodets/21929bf2a05625d1d67c 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; | |
sub handle-socket ($sock) { | |
$sock.print("thank you for subscribing to CAT FACTS\n"); | |
while (1) { | |
sleep 1; | |
$sock.print("please hold while we fetch your cat fact...\n"); | |
} | |
} | |
react { | |
whenever IO::Socket::Async.listen('localhost', 3005) -> $sock { | |
start { | |
handle-socket($sock); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment