Documentation

include MVC MVC.Animate MVC.Class MVC.Controller MVC.Controller.Action MVC.Controller.Action.Drag MVC.Controller.Action.Drop MVC.Controller.Action.EnterLeave MVC.Controller.Action.Event MVC.Controller.Action.Hover MVC.Controller.Action.Lasso MVC.Controller.Action.Selectable MVC.Controller.Action.Subscribe MVC.Controller.Comet MVC.Controller.Params MVC.Controller.Params.Drag MVC.Controller.Params.Drop MVC.Controller.Stateful MVC.Delegator MVC.Doc MVC.Element MVC.Event MVC.File MVC.History MVC.IO MVC.IO.Ajax MVC.IO.Comet MVC.IO.JsonP MVC.IO.WindowName MVC.IO.XDoc MVC.Model MVC.Model.Ajax MVC.Model.Cookie MVC.Model.JsonP MVC.Model.JsonRest MVC.Model.WindowName MVC.Model.XmlRest MVC.Native MVC.Native.Array MVC.Native.Date MVC.Native.Function MVC.Native.Number MVC.Native.Object MVC.Native.String MVC.Options MVC.Store MVC.SyntheticEvent MVC.Test MVC.Test.Assertions MVC.Test.Controller MVC.Test.Functional MVC.Test.Runner MVC.Test.Unit MVC.Timer MVC.Timer.Easings MVC.Vector MVC.View MVC.View.Helpers OpenAjax

MVC.Controller.Comet

Inherits: MVC.Controller
This class is used to handle starting a comet response and dispatching the response to other controllers for handling.
By default, comet controller queries the url of its className. For example:
JabbifyController = Controller.Comet.extend('jabbify',{},{})
connects to /jabbify
Comet controller expects data of the format:
{ClassName1: 
    {action1: [data1, data2 ...], 
     action2: [ ....], 
     ...
    }
 ClassName2: { .... }
}
If possible, Controller.Comet tries to create new instances of data, and dispatch to a matching controller action. For example:
{Todo: {create: [{name: 'wash dishes'}]}}
Will create a new Todo instance and call TodosController::create with that instance.

Static Methods

dispatch

dispatch(response) -> undefined
Dispatches to a controller and tries to send it instances if possible.
{Object} -

kill

kill() -> undefined
Kills the comet connection.

run

run(params) -> undefined
Starts the coment connection.
{} -

Prototype Methods

success

success(response) -> undefined
Called when the comet request successfully returns.
{Object} -