File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
plain/plain/server/workers Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1212import sys
1313import time
1414import traceback
15+ from abc import ABC , abstractmethod
1516from datetime import datetime
1617from random import randint
1718from ssl import SSLError
4849MAX_REQUESTS_JITTER = 50
4950
5051
51- class Worker :
52+ class Worker ( ABC ) :
5253 SIGNALS = [
5354 getattr (signal , f"SIG{ x } " )
5455 for x in ("ABRT HUP QUIT INT TERM USR1 USR2 WINCH CHLD" .split ())
@@ -105,13 +106,14 @@ def notify(self) -> None:
105106 """
106107 self .tmp .notify ()
107108
109+ @abstractmethod
108110 def run (self ) -> None :
109111 """\
110112 This is the mainloop of a worker process. You should override
111113 this method in a subclass to provide the intended behaviour
112114 for your particular evil schemes.
113115 """
114- raise NotImplementedError ()
116+ ...
115117
116118 def init_process (self ) -> None :
117119 """\
You can’t perform that action at this time.
0 commit comments