タグ

theschwartzに関するaklaswadのブックマーク (3)

  • TheSchwartzのworkerをテストする - Kentaro Kuribayashi's blog

    いま、MankiwというTheSchwartz/Gearmanのclient/worker/woker managerをいい感じにするモジュールを作っています。 https://github.com/kentaro/perl-mankiw これを作る過程で、TheSchwartzのworkerをテストする際に、こういう感じでやったらいいのかなーとやってみたので、ちょっと書いてみます。 workerのテストはなかなか書きにくいものです。ロジックは別のクラスにしておいて、workerからはそのクラスにパラメタを与えて呼び出すだけ、という感じにしておくのがテスタビリティ的にいいのだとは思いますが、まあ、実際ちゃんとTheSchwartz経由でテストしてみないことには安心できません。しかしその場合、TheSchwartzのworkerは、その性質上、非同期に動作するので、テストが面倒です。 そこで

    TheSchwartzのworkerをテストする - Kentaro Kuribayashi's blog
  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

  • 酒日記 はてな支店 - Deamon::Generic で TheSchwartz の worker をデーモン化する(1)

    TheSchwartz の worker をデーモンにしたくて、どうしようかと。daemontools でもいいんだろうけど、CPAN で見つけた Daemon::Generic を使ってみた。 まず TheSchwartz の client (jobを投入する) と worker (jobを実行する) モジュールを普通に作る。 #!/usr/bin/perl # client.pl use strict; use TheSchwartz; use YAML qw/ LoadFile /; my $client = TheSchwartz->new( %{ LoadFile(shift) } ); $client->insert( 'MyWorker' => { t => time } ); package MyWorker; use strict; use base qw/ TheSch

    酒日記 はてな支店 - Deamon::Generic で TheSchwartz の worker をデーモン化する(1)
  • 1