Skip to content

Instantly share code, notes, and snippets.

@rbrady
Last active March 9, 2017 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbrady/ff86c484e8e6e53ba2dc3dfa17b01b09 to your computer and use it in GitHub Desktop.
Save rbrady/ff86c484e8e6e53ba2dc3dfa17b01b09 to your computer and use it in GitHub Desktop.
Mistral Custom Actions ~ Using Base Classes
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
@d0ugal
Copy link

d0ugal commented Mar 9, 2017

Action would need an is_sync method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment