| 1 | package TaskPipe::ThreadManager::Settings; | ||
| 2 | |||
| 3 | 40 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 40 | with 'MooseX::ConfigCascade'; | |
| 5 | |||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | TaskPipe::ThreadManager::Settings - Settings for L<TaskPipe::ThreadManager> | ||
| 10 | |||
| 11 | =head1 METHODS | ||
| 12 | |||
| 13 | =over | ||
| 14 | |||
| 15 | =item max_threads | ||
| 16 | |||
| 17 | The maximum number of threads to use when running a plan. Taskpipe tries to adhere strictly to the number of threads you specify here - so parent threads are included in the value. You should experiment with your setup to determine the optimum value for your system | ||
| 18 | |||
| 19 | =cut | ||
| 20 | |||
| 21 | 40 | has max_threads => (is => 'ro', isa => 'Int', default => 80); | |
| 22 | |||
| 23 | |||
| 24 | |||
| 25 | =item refresh_mins | ||
| 26 | |||
| 27 | The number of minutes after which a thread should be refreshed. Refreshing a thread has the same effect as stopping the thread and running it again - it resumes where it left off, but obviously there is a performance penalty. The point of doing this is to mitigate memory leaks which occur in long running code. The less leaky the code, the longer C<refresh_mins> can be. (However, even L<LWP::UserAgent> and L<Web::Scraper> both appear to leak slightly in long runs, so it is probably better to accept leaks as a fact of life and compensate for them rather than spending hours trying to eliminate them entirely.) | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | 40 | has refresh_mins => (is => 'ro', isa => 'Int', default => 20); | |
| 32 | |||
| 33 | |||
| 34 | |||
| 35 | =item thread_table_deadlock_retries | ||
| 36 | |||
| 37 | The number of times to retry an update to the thread table in the event of a "serialization failure" (deadlock) | ||
| 38 | |||
| 39 | =cut | ||
| 40 | |||
| 41 | 40 | has thread_table_deadlock_retries => (is => 'ro', isa => 'Int', default => 4 ); | |
| 42 | |||
| 43 | |||
| 44 | |||
| 45 | =head1 AUTHOR | ||
| 46 | |||
| 47 | Tom Gracey <tomgracey@gmail.com> | ||
| 48 | |||
| 49 | =head1 COPYRIGHT AND LICENSE | ||
| 50 | |||
| 51 | Copyright (c) Tom Gracey 2018 | ||
| 52 | |||
| 53 | TaskPipe is free software, licensed under | ||
| 54 | |||
| 55 | The GNU Public License Version 3 | ||
| 56 | |||
| 57 | =cut | ||
| 58 | |||
| 59 | |||
| 60 | 40 | __PACKAGE__->meta->make_immutable; | |
| 61 | 40 | 1; | |
| 62 | |||