# New Ticket Created by   
# Please include the string:  [perl #127454]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127454 >


Hello,

I think is a bug, and I think it's in Perl6. I was not able to find a
work around for it in Perl6. My solution was to compile it in Perl.

The reported error is:

Net::WebSocket::Server parameter 'on_tick' expected type is CODE at -e
line 0.

  in method invoke
at 
/home/ubuntu/.rakudobrew/moar-nom/install/share/perl6/site/sources/286B9E53482EA4E593D57C652B8B62AFB56E5F0E
 line 482
  in method new
at 
/home/ubuntu/.rakudobrew/moar-nom/install/share/perl6/site/sources/286B9E53482EA4E593D57C652B8B62AFB56E5F0E
 line 741
  in block <unit> at ./test.pl line 7

Here is the program, in its entirety.
---------------------------------------------------------
#!/usr/bin/env perl6

use Inline::Perl5;

use Net::WebSocket::Server:from<Perl5>;

my $ws = Net::WebSocket::Server.new(
    listen => 3000,
    tick_period => 5,
    on_tick => sub {
        my ($serv) = @_;
        $_.send_utf8(time) for $serv.connections;
    },
    ).start;
---------------------------------------------------------

Sincerely,

Craig Haynie
Manchester, NH


Reply via email to