initialize() is not called every time the plugin is run, only every time it is initialized. You are probably confused because you are talking about a file type plugin run when adding books. If you add a single book at a time, a new worker processes is started for every add, which means the plugin is initialized for every add. However, if you do a recursive add, with more books than the number of CPU cores there will be a max number of worker processes equal to the number of cores on your system (say n) and initialize() will be caled only n times which is less than the number of books being added.
|