Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transfers: implement source selection strategies
Try to be more generic in the source filtering and selection code. Introduce a SourceRankingStrategy class, which has an `apply` method to actually apply the strategy to a source and decide what to do with a source. Some strategies are filter-only: i.e. they only decide if a source has to be ignored or not. Others are also ranking strategies: they can return an integer which defines the cost of the source according to this strategy. The order of ranking strategies is important: it defines the order in which the costs will be compared to sort the sources. This change will definitely introduce some computational and memory overhead, but I hope it will be low. Instead of hard-coded `filter()` calls which are done once per request, now we have multiple object traversals and function calls for each source of each request.
- Loading branch information