##// END OF EJS Templates
added provided and configure methods to the fluent container configuration, added applyConfig method to the container
added provided and configure methods to the fluent container configuration, added applyConfig method to the container

File last commit:

r63:fb1f84f91895 default
r142:be7edf08a115 v1.4.0-rc3 default
Show More
Client.js
60 lines | 1.9 KiB | application/javascript | JavascriptLexer
cin
working version...
r51 define(
[ "dojo/_base/declare", "dojo/_base/lang", "dojo/Evented", "../log/_LogMixin" ],
function(declare, lang, Evented, _LogMixin) {
return declare([ Evented, _LogMixin ], {
_session : null,
_destination : null,
_id : null,
cin
updated build script, added eslint
r63 constructor : function(session, destination) {
cin
working version...
r51 this._destination = destination;
this._session = session;
},
getDestination : function() {
return this._destination;
},
start : function() {
var me = this;
return me._session.createClient(me.prepareOptions({})).then(
function(id) {
me._id = id;
return me;
});
},
prepareOptions : function(options) {
var me = this;
options.mode = me.getMode();
options.destination = me.getDestination();
options.client = function(msg) {
me.process(msg);
};
return options;
},
cin
updated build script, added eslint
r63 process : function() {
cin
working version...
r51 this.warn("Messages are not acceped by this client");
},
stop : function() {
var me = this;
if (me._id) {
me.log("stop");
return me._session.deleteClient({'clientId': me._id}).then(function() {
me._id = null;
return me;
});
}
},
toString : function() {
return "["
+ [
this.getMode().toUpperCase(),
this.getDestination(),
this._id ].join(',') + "]";
}
});
});