Play With Theschwartz
Upcoming SlideShare
Loading in...5
×
 

Play With Theschwartz

on

  • 3,958 views

 

Statistics

Views

Total Views
3,958
Views on SlideShare
3,953
Embed Views
5

Actions

Likes
3
Downloads
6
Comments
0

2 Embeds 5

http://www.slideshare.net 4
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Play With Theschwartz Play With Theschwartz Presentation Transcript

  • Play with TheSchwartz Hideo Kimura (hidek)
  • about me
    • name:
      • hide-k
      • hidek
      • hide
      • hide-san
      • hideki
      • hidekku…
      • whatever you want to call =)
    • working at:
      • KDDI Web Communications (hosting company)
    • perl:
      • office: developing management control panel for customers
      • private: perl-users.jp, catalyst
  • TheSchwartz
    • Reliable Job queue system
      • using MySQL (SQLite is “ok”)
    • MovableType
    • CodeRepos commit ping
    • sending tons of emails
    • creating guest hosts for VPS
  • Data::ObjectDriver
    • using Data::ObjectDriver as OR mapper
      • job
      • funcmap
      • error
      • exitstatus
      • note
  • TheSchwartz::Simple
    • using DBI dbh directly for Job insertion.
    • NOT including worker
  • Job attributes
    • jobid
    • funcid
    • arg
    • uniqkey
    • insert_time
    • run_after
    • grabbed_until
    • priority
    • coalesce
  • Coalesce Jobs
    • $job->coalesce(“yahoo.com@$id”);
    • $client->find_job_with_coalescing_prefix( ‘MyWorker’, ‘yahoo.com’ );
  • Split Job
    • sub work { ... foreach my $id (@ids) { my $new_job = TheSchwartz::Job->new( funcname => 'Worker::Child', args => $args coalesce => "parent-$id", ); push @new_jobs, $new_job; } $job->replace_with(@new_jobs); }
  • Monitor Jobs
    • $client->list_jobs({'funcname' => 'MyApp::Worker'} )
    • $client->lookup_job($handle_id)
    • $client->find_job_with_coalescing_prefix( $class, $prefix )
    • $client->find_job_with_coalescing_value( $class, $value )
  • Monitor Jobs from Catalyst
    • use base 'Catalyst::Model::Adaptor';
    • $c->model(‘TheSchwartz’)->insert($job);
    • $c->stash->{jobs} = $c->model('TheSchwartz')->list_jobs( {'funcname' => 'MyApp::Worker'} );
  • Thank you, and questions?