Changeset 10155


Ignore:
Timestamp:
2005-06-23T11:18:41+12:00 (19 years ago)
Author:
davidb
Message:

deinit subroutine added that balances out init routine. 'init' called only
once when pipeline is set up. deinit now called when *every* pass using
the pipeline has finished. Note this is different to the 'begin' and 'end'
subroutines that can potentially be called just before a new round of
file processing with the pipeline (note: presently only buildcol.pl makes
multiple passes using the pipeline, importing only uses one pass).

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugin.pm

    r9853 r10155  
    105105}
    106106
     107
    107108sub metadata_read {
    108109    my ($pluginfo, $base_dir, $file, $metadata, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli, $aux) = @_;
     
    289290}
    290291
     292sub deinit {
     293    my ($pluginfo, $processor) = @_;
     294   
     295
     296    map { $_->deinit($processor); } @$pluginfo;
     297}
     298
    2912991;
  • trunk/gsdl/perllib/plugins/BasPlug.pm

    r9961 r10155  
    453453
    454454sub end {
     455    # potentially called at the end of each plugin pass
     456    # import.pl only has one plugin pass, but buildcol.pl has multiple ones
     457
    455458    my ($self) = @_;
    456459    $self->finalise_extractors();
     460}
     461
     462sub deinit {
     463    # called only once, after all plugin passes have been done
     464
     465    my ($self) = @_;
    457466}
    458467
Note: See TracChangeset for help on using the changeset viewer.