Created
January 26, 2020 06:38
-
-
Save geoffkoh/1a983024c016c369557dad8376110111 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExecutorFactory: | |
""" The factory class for creating executors""" | |
registry = {} | |
""" Internal registry for available executors """ | |
@classmethod | |
def create_executor(cls, name: str, **kwargs) -> 'ExecutorBase': | |
""" Factory command to create the executor """ | |
exec_class = cls.registry[name] | |
executor = exec_class(**kwargs) | |
return executor | |
# end create_executor() | |
# end class ExecutorFactory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment