Last active
March 9, 2017 17:20
-
-
Save rbrady/ff86c484e8e6e53ba2dc3dfa17b01b09 to your computer and use it in GitHub Desktop.
Mistral Custom Actions ~ Using Base Classes
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
import abc | |
class Action(object): | |
@abc.abstractmethod | |
def run(self): | |
pass | |
class ContextAction(Action): | |
@abc.abstractmethod | |
def run(self, context): | |
pass | |
class AsyncAction(Action): | |
def is_sync(self): | |
"""Returns False if the action is asynchronous, otherwise True.""" | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Action would need an
is_sync
method.