Skip to content

Instantly share code, notes, and snippets.

@typester
Created November 27, 2008 05:10
Show Gist options
  • Save typester/29685 to your computer and use it in GitHub Desktop.
Save typester/29685 to your computer and use it in GitHub Desktop.
package Service::Chat;
use Moose;
extends 'Kamaitachi::Service';
with qw/Kamaitachi::Service::AutoConnect
Kamaitachi::Service::Broadcaster
/;
sub on_invoke_send {
my ($self, $session, $req) = @_;
my $msg = $req->args->[1];
my $res = $self->notify_packet( onMessage => $msg );
$self->broadcast( $session => $res );
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment