fix some inaccuracies in the documentation
[chaz/chatty] / lib / Chatty / Model / Meteor.pm
1 package Chatty::Model::Meteor;
2 use Moose;
3 use namespace::autoclean;
4
5 use IO::Socket;
6
7 extends 'Catalyst::Model';
8
9 # TODO: does not reconnect to cometd if connection is broken
10 has 'cnx' => (
11 is => 'ro',
12 lazy => 1,
13 required => 1,
14 default => sub {
15 IO::Socket::INET->new(
16 PeerAddr => 'localhost',
17 PeerPort => 4671,
18 Proto => 'tcp'
19 );
20 },
21 );
22
23 =head1 NAME
24
25 Chatty::Model::Meteor - Catalyst Model
26
27 =head1 DESCRIPTION
28
29 Handles interaction with the meteor comet server.
30
31 =head1 METHODS
32
33 =head2 addMessage
34
35 Post a message to the server.
36
37 =cut
38
39 sub addMessage {
40 my ($self, $channel, $message) = @_;
41 my $cnx = $self->cnx;
42 print $cnx "ADDMESSAGE $channel $message\n";
43 }
44
45 =head1 AUTHOR
46
47 Charles McGarvey
48
49 =head1 LICENSE
50
51 This library is free software. You can redistribute it and/or modify
52 it under the same terms as Perl itself.
53
54 =cut
55
56 __PACKAGE__->meta->make_immutable;
57 1;
This page took 0.03176 seconds and 4 git commands to generate.