Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Merge concepts from Controller and Factory into a new type of controller #14

Open
twolfson opened this issue Jan 18, 2013 · 0 comments
Open

Comments

@twolfson
Copy link
Collaborator

_PAST THOUGHTS_ (but still good)

A new breed of controller

Controllers should be replicatable:

When .start is called, it calls back with an id
.stop takes in that id to know which instance to stop

Controllers should be smart:

If .start is called with a container that is currently being used, restart (.stop, .start) that instance

Controllers should be expressive and object oriented:

Custom methods via Sauron .channel('controllers/main/1').voice('shuffle')
// We can also make sugar via Sauron.addControllerMethod('shuffle') (which should be auto-handled by BaseController via a new parameter like 'methods')

Controllers should have an auto-restart on failure: (Attribution to Addy Osmandi for everything but especially this)

Sauron .method = function () { try { controller.shuffle(); } catch { restart(controller.id); } );
// To be clear: it should be Sauron doing the restarting
// This may get hairy when mixed with object oriented as we will need to return the state of the controller
// So, introduce a 'state' object as an optional first parameter and allow for a Sauron ('updateState', 'controllers/main/1')
// which will be used upon any restarts
// Additionally, each controller constructor will keep a hash map of counter id to container used for restart (once again, part of the state)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant