Skip to content

Commit

Permalink
v.0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikos M committed May 10, 2016
1 parent 0ddb1da commit 96819f1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/RT.BOSH.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ RT.Client.BOSH[PROTO].send = function( payload ){
};
RT.Client.BOSH[PROTO].listen = function( ){
var self = this;
self.emit( 'open' );
var listen = function listen( ) {
self.$recv$ = XHR.create({
url : self.$cfg$.url + (-1 < self.$cfg$.url.indexOf('?') ? '&' : '?') + '__nocache__='+(new Date().getTime()),
Expand Down Expand Up @@ -135,7 +134,8 @@ RT.Client.BOSH[PROTO].listen = function( ){
}, null);
};
setTimeout( listen, 0 );
return self;
return self.emit( 'open' );

};

// export it
Expand Down
2 changes: 1 addition & 1 deletion src/RT.BOSH.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions src/RT.Poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ RT.Client.Poll[PROTO].abort = function( trigger ){
if ( self.$xhr$ ) { self.$xhr$.abort( true===trigger ); self.$xhr$ = null; }
return self;
};
RT.Client.Poll[PROTO].$poll$ = function( immediate ){
RT.Client.Poll[PROTO].send = function( payload ){
var self = this;
self.$queue$.push( String(payload) );
return self;
};
RT.Client.Poll[PROTO].listen = function( ){
var self = this;
var poll = function poll( ) {
var headers = {
Expand Down Expand Up @@ -111,17 +116,8 @@ RT.Client.Poll[PROTO].$poll$ = function( immediate ){
}
}, msgs ? ('rt_payload='+U.Url.encode( msgs.join( rt_msg ) )) : null);
};
self.$timer$ = setTimeout(poll, true === immediate ? 0 : self.$cfg$.pollInterval);
return self;
};
RT.Client.Poll[PROTO].send = function( payload ){
var self = this;
self.$queue$.push( String(payload) );
return self;
};
RT.Client.Poll[PROTO].listen = function( ){
var self = this;
return self.emit( 'open' ).$poll$( true );
self.$timer$ = setTimeout(poll, 0);
return self.emit( 'open' );
};

// export it
Expand Down
2 changes: 1 addition & 1 deletion src/RT.Poll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 96819f1

Please sign in to comment.