Upgrade to Pro — share decks privately, control downloads, hide ads and more …

cpm at okinawa

cpm at okinawa

2016.08.27 okinawa.pm

Shoichi Kaji

August 27, 2016
Tweet

More Decks by Shoichi Kaji

Other Decks in Programming

Transcript

  1. About me • Shoichi Kaji • Born in 1984 •

    Born in Kanagawa, live in Tokyo • Work for Yahoo JAPAN • pause/github: skaji • perl5: cpm, Mojo::SlackRTM • perl6: mi6, frinfon
  2. ͳͥcpmΛͭ͘Ζ͏ͱࢥ͔ͬͨ • CPAN moduleΛ͍ͭ΋࢖͍ͬͯͨ (΋ͪΖΜࠓ΋) • ΋ͬͱ଎͘ΠϯετʔϧͰ͖Ε͹ͳɺͱ͍ͭ΋ࢥͬ ͍ͯͨ • CPAN

    moduleΠϯετʔϧ͸͋ΔछϒϥοΫϘο Ϋεͱͳ͍ͬͯͯखΛग़͢ਓ͸ඇৗʹݶΒΕ͍ͯͨ • ΋ͷ͸ࢼ͠ɺ΍ͬͯΈΑ͏
  3. ଎͞Λ࣮ݱ͢ΔͨΊͷ࣮૷Ҋ • cpanm͸"௚ྻ"ʹCPAN moduleΛΠϯετʔϧ͍ͯͨ͘͠Ί ͋·Γ଎͘ͳ͍ɻͲ͏͢Δ͔ɻ(perl5Ͱ"଎͞"ΛٻΊΔͱ͢Ε ͹event driven or fork(2)ͱ͍͏͜ͱʹͳΔɻ) •

    (Ҋ1) event driven
 Ͱ͖ΔݶΓcpanmͷίʔυΛ࠶ར༻͔ͨͬͨ͠ɻevent drivenͷίʔυͷதͰcpanmΛ࢖͏ͷ͸ͪΐͬͱແཧɻ • (Ҋ2) forkΛ࢖͏
 ·͋ͪ͜ΒͰɻ
  4. CPAN moduleฒྻԽ͸
 Կ͕໘౗͔ • ࣄલʹ͢΂ͯͷtask͕ܾ·͍ͬͯͳ͍ɻ
 ྫ͑͹ PlackΛΠϯετʔϧ͠Α͏ͱ͢Δͱ͖ • ࠷ॳ͸"PlackΠϯετʔϧ"ͱ͍͏task͚͕ͩͩ •

    ͦΕͷmetadataΛfetchͨ͠ஈ֊ͰॳΊͯ File::ShareDir::InstallͷΠϯετʔϧ΋ඞཁͩͱൃ֮͢Δɻ • ͞ΒʹFSDIͷmetadataΛfetch͢ΔͱModule::Build::Tiny ΋ඞཁͩͱൃ֮͢Δɻblah blah blah…
  5. ͦͷ໘౗͞Λ͍͔ʹ
 γϯϓϧʹଊ͔͑ͨ • (1) "CPAN moduleΠϯετʔϧ"Λɺ
 ಠཱͰ࣮ߦՄೳͳࡉ͔͍taskʹ෼͚Δɻ(ࠓճ͸ ͜ͷઆ໌লུ) • (2)

    ͦͷtaskΛworkerʹৼΓɺ݁ՌΛऩूͯ͠ɺ ͞Βʹ৽ͨͳtask͕ੜ·ΕΕ͹ɺ࠶ͼworkerʹ ৼΔɻ͜ΕΛtask͕ͳ͘ͳΔ·Ͱ܁Γฦ͢ɻ
  6. ࠓޙ • cpm is a fast CPAN module installer •

    cpmΛsandboxͱͯ͠CPANͷ͋Δ΂͖࢟Λ໛ࡧͨ͠ ͍ • Ͱɺcpanmʹ͍͍ͱ͜ΖΛؐݩ͢Δʂ • cpmͷparallelͷ෦෼͸Parallel::Pipesͱͯ͠Ϟδϡʔ ϧʹ෼཭ͤͨ͞ɻଞʹ΋Ԡ༻Մೳͩͱࢥ͍ͬͯΔͷͰɺ ୭͔ʹ࢖ͬͯ΋Β͍͍ͨ :-)