Skip to content

Commit 6fbc46f

Browse files
committed
Make Executor an abstract class
1 parent 65c013c commit 6fbc46f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cms/io/triggeredservice.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@
2828
from __future__ import unicode_literals
2929
from future.builtins.disabled import * # noqa
3030
from future.builtins import * # noqa
31+
from six import with_metaclass
3132

3233
import logging
3334
import time
35+
from abc import ABCMeta, abstractmethod
3436

3537
import gevent
3638
from gevent.event import Event
@@ -42,7 +44,7 @@
4244
logger = logging.getLogger(__name__)
4345

4446

45-
class Executor(object): # pylint: disable=R0921
47+
class Executor(with_metaclass(ABCMeta, object)): # pylint: disable=R0921
4648

4749
"""A class taking care of executing operations.
4850
@@ -170,6 +172,7 @@ def max_operations_per_batch(self):
170172
"""
171173
return 0
172174

175+
@abstractmethod
173176
def execute(self, entry):
174177
"""Perform a single operation.
175178
@@ -183,7 +186,7 @@ def execute(self, entry):
183186
re-enqueue the item.
184187
185188
"""
186-
raise NotImplementedError("Please use a subclass.")
189+
pass
187190

188191

189192
class TriggeredService(Service):

0 commit comments

Comments
 (0)