BaseFlumine.add_xxx() methods should check for duplicates
mzaja opened this issue · 0 comments
As of #685 getting merged, BaseStrategy.add()
method receives flumine
as an argument. This makes it elegant to add e.g. strategy-specific middleware or workers inside the strategy itself. The problem arises when multiple strategies require the same resource and add it multiple times.
As with streams, all the methods outlined below should check whether a resource has already been added and reject duplicates. The test should be if resource not in [resource_1, resource_2, ...] then add_resource()
. It would then be expected of the end user to override __eq__()
method of each custom resource to determine what constitutes a duplicate.
flumine/flumine/baseflumine.py
Lines 102 to 122 in bfaa5de