The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Gungho::Component::Throttle - スロットリング用ベースクラス

SYNOPSIS

  package Gungho::Component::Throttle::Domain;
  use base qw(Gungho::Component::Throttle);

DESCRIPTION

クローラー作�時��必�リクエスト数を調整�るスロットリング�必���り��。 ��コン�ー�ント�スロットリング�親クラス���機能���。実際� スロットリング�Throttle::SimpleやThrottle::Domain�よ���クラス�行���。

Gungho::Component::Throttle::Simple��純�時間当�り�リクエスト�数を ベース�スロットリングを行���。�ん�リクエスト����も時間��り� リクエスト�数��定値を上回��時点�スロットリング�れ��。

  # throttle down to 100 requests / hour
  components:
    - Throttle::Simple
  throttle:
    simple:
      max_iterms: 100
      interval: 3600

Gungho::Component::Throttle::Domain�ホスト�ーム毎�スロットリングを行���。 ホスト毎�時間当�り�リクエスト�数��定値を上回��時点�スロットリング �れるよ���り��。

  # throttle down to 100 requests / host / hour
  components:
    - Throttle::Domain
  throttle:
    domain:
      max_iterms: 100
      interval: 3600

Throttle::Domainã�¨Throttle::Simpleã�¯å†…部的ã�«Data::Throttlerã€�ã‚‚ã�—ã��ã�¯ Data::Throttler::Memcachedを使用ã�—ã�¾ã�™ã€‚1å�°ã�®ãƒ›ã‚¹ãƒˆã�§ã‚¯ãƒ­ãƒ¼ãƒ©ãƒ¼ã‚’å‹•ã�‹ã�—ã�¦ã�„ã‚‹ å ´å�ˆã�¯æ™®é€šã�®Data::Throttlerã�§äº‹è¶³ã‚Šã�¾ã�™ã�Œã€�ã‚‚ã�—複数ホストã�§ã�®é�‹ç”¨ã‚’è¡Œã�† å ´å�ˆã�¯ã‚¹ãƒ­ãƒƒãƒˆãƒªãƒ³ã‚°ãƒ‡ãƒ¼ã‚¿ã‚’å…¨ã�¦ã�®ãƒ›ã‚¹ãƒˆé–“ã�§å…±æœ‰ã�™ã‚‹å¿…è¦�ã�Œã�‚ã‚Šã�¾ã�™ã€‚ã�“ã�®å ´å�ˆã�¯ 設定ã�§throttlerタイプを指定ã�—ã€�memcachedãƒ�ックエンドを使用ã�™ã‚‹ Data::Throttler::Memcachedを使用ã�—ã�¦ã��ã� ã�•ã�„:

  components:
    - Throttle::Domain
  throttle:
    domain:
      throttler: Data::Throttler::Memcached
      cache:
        data: 127.0.0.1:11211
      max_items: 100
      interval: 3600

METHODS

feature_name

throttle

send_request

SEE ALSO

Gungho::Component::Throttle::Simple Gungho::Component::Throttle::Domain

1 POD Error

The following errors were encountered while parsing the POD:

Around line 3:

Non-ASCII character seen before =encoding in 'スロットリング用ベースクラス'. Assuming CP1252