Poller takes care of periodical feeds updates. It makes regular scans of the feeds lists attempting to find the feeds requiring to be updated. The period of these scans is defined by scanPeriod
property.
Poller is always dedicated to some guides set and works only with it. This decision was made to simplify scanning of feeds and does not limit the functionality as the application always have only one active guide set.
This class has convenient methods to force updates of the feeds out of the schedule. They are:
update()
- updates all feeds (indirectly) in all guides.update(IGuide)
- updates all feeds (indirectly) in given guide.update(IFeed)
- updates the feed. The feed can be updated directly (meaning that the updating of this particular feed is required) or indirectly (meaning that the updating of the feed happens as a part of bigger update: guide or whole set). Before actually doing the update Poller asks each of the feeds whether they can be updated or not. The feed decides, taking in account the fact of direct or indirect call, last poll date and other factors, if it would like to be updated. If it would like to then the Poller puts the feed in queue for updates.
Poller owns some number of worker threads which are waiting for the tasks in the queue. Once they grab the task from the queue, they follow update procedure. After they finish they move back to the fetching of the next task.
|
|