姫ヒャクを支える技術

yokohamapm #10

Feb 21st, 2014

Profile

songmu

姫騎士と最後の百竜戦争

姫騎士と最後の百竜戦争

WEB+DB PRESS に寄稿しました

webdb vol79

特にネタがないので最近書いたCPANモジュールの紹介

App::RunCron

% runcron -- /path/to/command

UnazuSan

fujiwara

UnazuSan

use UnazuSan;
my $unazu_san = UnazuSan->new(
    host       => 'example.com',
    password   => 'xxxxxxxx',
    join_channels => [qw/test/],
);
$unazu_san->on_message(
    qr/^unazu_san:/ => sub {
        my $receive = shift;
        $receive->reply('うんうん');
    },
);
$unazu_san->on_command(
    help => sub {
        my ($receive, @args) = @_;
        $receive->reply('help '. ($args[0] || ''));
    }
);
$unazu_san->run;

Gearman::Starter

% gearman-starter.pl --server=127.0.0.1:7003 MyApp::Worker::Hoge MyApp::Worker::Fuga

APNS::Agent

% apns-agent --certificate=path/to/cert.cer --private-key=path/to/cer.key
Twiggy: Accepting connections at http://0.0.0.0:4905/
% curl http://127.0.0.1:4905 -d 'token=1111111111111111111111111111111111111111111111111111111111111111&alert=test%20message'

Teng::Plugin::ResultSet

Cache::Scalar::WithExpiry

use Cache::Scalar::WithExpiry;
use feature qw/state/;

state $cache = Cache::Scalar::WithExpiry->new();
my ($value, $expiry_epoch) = $cache->get_or_set(sub {
    my $val          = Storage->get;
    my $expiry_epoch = time + 20;
    return ($val, $expiry_epoch); # cache in 20 seconds
});

Time::Piece::Plus (急遽追加)

以上