Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Refactor Controller #160

Closed
JustinTervala opened this issue Sep 15, 2017 · 1 comment
Closed

Refactor Controller #160

JustinTervala opened this issue Sep 15, 2017 · 1 comment

Comments

@JustinTervala
Copy link
Contributor

the core.controller object is becoming bloated and rigid. I propose that we break it up as follows (pseudocode):

class WorkflowExecutor:
	self.executor = MultiprocessesExecutor()
	self.playbook_store = PlaybookStore()
	self.scheduler = scheduler()

class MultiprocessedExecutor():
	def execute_workflow(Workflow)
	def pause_workflow(workflow_execution_uid, workflow_name)
	def resume_workflow(workflow_execution_uid, workflow_name)
	def _event_callback
		# maybe all execution elements could call a single blinker signal. MultiprocessedExecutor connects that signal. No need for injecting callbacks deep into workflow structure
	def shutdown()

class PlaybookStore():
	self.playbooks = {playbook_name: Playbook}
	self.playbook_loader = JsonPlaybookLoader()

class JsonPlaybookLoader:
	# These may all be static for some loaders. Keep them in a class. Essentially allow module to be used as a field in PlaybookStore
	def load_workflow(resource_location, workflow_name, playbook_name)
	def load_playbook(resource_location)
	def load_all(resource_collection_location)

class Playbook():
	self.name
	self.workflows = {uid: Workflow}
	def as_json()
@JustinTervala
Copy link
Contributor Author

Of these objects, I think getting a MultiprocessedExecutor object and a Playbook object are the most important.

@JustinTervala JustinTervala added this to Backlog in Walkoff Sep 15, 2017
@JustinTervala JustinTervala moved this from Backlog to In progress in Walkoff Oct 5, 2017
@JustinTervala JustinTervala moved this from In progress to Done in Walkoff Oct 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Walkoff
  
Done
Development

No branches or pull requests

2 participants