Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Transport#request no longer needs to return anything.

  • Loading branch information...
commit 1355735c67f4eef4b2588b1cedad26fe01a368f0 1 parent e1e6988
James Coglan jcoglan authored
25 javascript/network/browser.js
View
@@ -8,7 +8,6 @@ Faye.WebSocketTransport = Faye.Class(Faye.Transport, {
this._connectMessage = message;
this.withSocket(function(socket) { socket.send(Faye.toJSON(message)) });
- return this;
},
withSocket: function(callback, scope) {
@@ -57,7 +56,7 @@ Faye.XHRTransport = Faye.Class(Faye.Transport, {
request: function(message, timeout) {
var timeout = timeout || this._client.getTimeout();
- return Faye.XHR.request('post', this._endpoint, Faye.toJSON(message), {
+ Faye.XHR.request('post', this._endpoint, Faye.toJSON(message), {
success:function(response) {
this.receive(JSON.parse(response.text()));
},
@@ -66,10 +65,6 @@ Faye.XHRTransport = Faye.Class(Faye.Transport, {
setTimeout(function() { self.request(message, 2 * timeout) }, 1000 * timeout);
}
}, this);
- },
-
- abort: function(request) {
- request.abort();
}
});
@@ -90,17 +85,22 @@ Faye.JSONPTransport = Faye.extend(Faye.Class(Faye.Transport, {
location = Faye.URI.parse(this._endpoint, params),
self = this;
+ var removeScript = function() {
+ if (!script.parentNode) return false;
+ script.parentNode.removeChild(script);
+ return true;
+ };
+
Faye.ENV[callbackName] = function(data) {
Faye.ENV[callbackName] = undefined;
try { delete Faye.ENV[callbackName] } catch (e) {}
- if (!script.parentNode) return;
- head.removeChild(script);
+ if (!removeScript()) return;
self.receive(data);
};
setTimeout(function() {
if (!Faye.ENV[callbackName]) return;
- self.abort(script);
+ removeScript();
self.request(message, 2 * timeout);
}, 1000 * timeout);
@@ -108,13 +108,6 @@ Faye.JSONPTransport = Faye.extend(Faye.Class(Faye.Transport, {
script.type = 'text/javascript';
script.src = location.toURL();
head.appendChild(script);
-
- return script;
- },
-
- abort: function(script) {
- if (!script.parentNode) return;
- script.parentNode.removeChild(script);
}
}), {
_cbCount: 0,
3  javascript/network/node.js
View
@@ -10,8 +10,6 @@ Faye.NodeHttpTransport = Faye.Class(Faye.Transport, {
});
});
request.end();
-
- return request;
},
createRequestForMessage: function(message, timeout) {
@@ -47,7 +45,6 @@ Faye.Transport.register('long-polling', Faye.NodeHttpTransport);
Faye.NodeLocalTransport = Faye.Class(Faye.Transport, {
request: function(message) {
this._endpoint.process(message, true, this.receive, this);
- return true;
}
});
4 javascript/network/transport.js
View
@@ -19,9 +19,7 @@ Faye.Transport = Faye.extend(Faye.Class({
this._client._clientId, this._endpoint, responses);
Faye.each(responses, this._client.receiveMessage, this._client);
- },
-
- abort: function() {}
+ }
}), {
get: function(client, connectionTypes) {
3  lib/faye/network/transport.rb
View
@@ -85,8 +85,6 @@ def request(message, timeout = nil)
request.errback do
EventMachine.add_timer(timeout) { request(message, 2 * timeout) }
end
-
- request
end
end
Transport.register 'long-polling', HttpTransport
@@ -98,7 +96,6 @@ def self.usable?(endpoint)
def request(message)
@endpoint.process(message, true, &method(:receive))
- true
end
end
Transport.register 'in-process', LocalTransport
Please sign in to comment.
Something went wrong with that request. Please try again.