AnyEvent-Campfire-Client
view release on metacpan or search on metacpan
examples/test.pl view on Meta::CPAN
$client->lock(
'535881',
sub {
my ( $body, $hdr ) = @_;
if ( $hdr->{Status} !~ m/2/ ) {
$client->emit( 'error', "$hdr->{Status}: $hdr->{Reason}" );
$client->exit;
}
else {
print "$hdr->{Status}: locked room\n";
$client->unlock(
'535881',
sub {
my ( $body, $hdr ) = @_;
if ( $hdr->{Status} !~ m/2/ ) {
$client->emit( 'error',
"$hdr->{Status}: $hdr->{Reason}" );
$client->exit;
}
else {
print "$hdr->{Status}: unlocked room\n";
$client->exit;
}
}
);
}
}
);
# $client->put_room('535881', encode_json({ room => { name => 'Room 1', topic => 'oops' } }), sub {
# my ($body, $hdr) = @_;
( run in 0.740 second using v1.01-cache-2.11-cpan-49f99fa48dc )