Skip to content

Instantly share code, notes, and snippets.

Created September 25, 2015 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c4b70a65e2475ff25968 to your computer and use it in GitHub Desktop.
Save anonymous/c4b70a65e2475ff25968 to your computer and use it in GitHub Desktop.
my $server-line-supply = supply {
my $chars = '';
whenever $conn.chars-supply {
$chars ~= $_;
my @lines = $chars.split(/\n/);
if @lines[*-1] eq '' {
$chars = @lines[*-2];
emit $_ for @lines[0..*-3];
}
else { emit $_ for @lines; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment