summaryrefslogtreecommitdiff
path: root/js/dojo-1.7.2/dojox/cometd/HttpChannels.js
blob: 5b1339720c4861ea0e9e4b1aef5b90bc99e9f666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//>>built
// wrapped by build app
define("dojox/cometd/HttpChannels", ["dijit","dojo","dojox","dojo/require!dojox/io/httpParse,dojox/cometd/RestChannels"], function(dijit,dojo,dojox){
dojo.provide("dojox.cometd.HttpChannels");
 
dojo.require("dojox.io.httpParse");
dojo.require("dojox.cometd.RestChannels");
// Note that cometd _base is _not_ required, this can run standalone, but ifyou want
// cometd functionality, you must explicitly load/require it elsewhere, and cometd._base
// MUST be loaded prior to HttpChannels ifyou use it.

// summary:
// 		HttpChannels - An HTTP Based approach to Comet transport with full HTTP messaging
// 		semantics including REST. HttpChannels is exactly the same as RestChannels, loading HttpChannels simply ensures that http parsing
//		capabilities are present for application/http messages

// description:
// 		This can be used:
// 		1. As a cometd transport
// 		2. As an enhancement for the REST RPC service, to enable "live" data (real-time updates directly alter the data in indexes)
// 		2a. With the JsonRestStore (which is driven by the REST RPC service), so this dojo.data has real-time data. Updates can be heard through the dojo.data notification API.
// 		3. As a standalone transport. To use it as a standalone transport looks like this:
// 	|		dojox.cometd.HttpChannels.open();
// 	|		dojox.cometd.HttpChannels.get("/myResource",{callback:function(){
// 	|			// this is called when the resource is first retrieved and any time the
// 	|			// resource is changed in the future. This provides a means for retrieving a
// 	|			// resource and subscribing to it in a single request
// 	|		});
// 	|	dojox.cometd.HttpChannels.subscribe("/anotherResource",{callback:function(){
// 	|		// this is called when the resource is changed in the future
// 	|	});
// 		Channels HTTP can be configured to a different delays:
// 	|	dojox.cometd.HttpChannels.autoReconnectTime = 60000; // reconnect after one minute
//
dojox.cometd.HttpChannels = dojox.cometd.RestChannels;

});