aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-03-12 14:54:15 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-03-12 14:54:15 +0100
commit7a03b73f331cd47be63ce55643cd884c9cf32b40 (patch)
tree6d7b9bb3adbbb456fedb59393145e434fc90271b /python
parent6f329d030ab2ee89461bbc3fd9cdbd25b58b4021 (diff)
downloadsandcrawler-7a03b73f331cd47be63ce55643cd884c9cf32b40.tar.gz
sandcrawler-7a03b73f331cd47be63ce55643cd884c9cf32b40.zip
workers: add explicit process to base class
As per https://docs.python.org/3/library/exceptions.html#NotImplementedError > In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method [...].
Diffstat (limited to 'python')
-rw-r--r--python/sandcrawler/workers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/sandcrawler/workers.py b/python/sandcrawler/workers.py
index c290421..54bd581 100644
--- a/python/sandcrawler/workers.py
+++ b/python/sandcrawler/workers.py
@@ -52,6 +52,12 @@ class SandcrawlerWorker(object):
print("Worker: {}".format(self.counts), file=sys.stderr)
return self.counts
+ def process(self, task):
+ """
+ Derived workers need to implement business logic here.
+ """
+ raise NotImplementedError('implementation required')
+
class MultiprocessWrapper(SandcrawlerWorker):
def __init__(self, worker, sink, jobs=None):