Comments (7)
I like it. Will add it now. Do you have a sample you can share so I can test?
from atmosphere.
So the new code will looks like
invokeCallback: function(response) {
var call = function (index, func) {
func(response);
};
if (typeof(jQuery.atmosphere.request.callback) == 'function') {
jQuery.atmosphere.request.callback(response);
} else {
jQuery.atmosphere.log(logLevel, ["Invoking " + jQuery.atmosphere.callbacks.length + " callbacks"]);
if (jQuery.atmosphere.callbacks.length > 0) {
jQuery.each(jQuery.atmosphere.callbacks, call);
}
}
}
Is that OK?
from atmosphere.
Yes, this is the idea.
But maybe, "jQuery.atmosphere.callbacks" schould be call even if "jQuery.atmosphere.request.callback" is defined.
With this, you can define one callback per request and "global" callbacks for all request. I don't know if it is the best choice, but I think it can be usefull to have "global" callbacks.
How I fixed it :
invokeCallback: function(response) {
var call = function (index, func) {
func(response);
};
// Invoke global callbacks
jQuery.atmosphere.log(logLevel, ["Invoking " + jQuery.atmosphere.callbacks.length + " callbacks"]);
if (jQuery.atmosphere.callbacks.length > 0) {
jQuery.each(jQuery.atmosphere.callbacks, call);
}
// Invoke request callback
if (typeof(jQuery.atmosphere.request.callback) == 'function') {
jQuery.atmosphere.request.callback(response);
}
}
I can write a sample you can test, where can I send it to you ?
from atmosphere.
Make a lot of sence. Use [email protected]
Thanks a lot!
from atmosphere.
OK I've integrated it with a basic test. Still highly interested to a simple sample if you have a chance. Thanks a lot.
from atmosphere.
I just sent you my sample at [email protected].
Thanks!
from atmosphere.
Works like a charm!!!
Thanks!
from atmosphere.
Related Issues (20)
- Potential Refactoring Estimate HOT 1
- SSE doesn't output error bodies, just spaces
- Compress JSON messages with atmosphere
- Compression websocket messages HOT 8
- Provide runtime hints for Spring Boot 3 native applications HOT 1
- Support atmosphere-spring for Jakarta 3.0 jakarta.servlet HOT 8
- Broadcasters with names that contain both { and } are never cleaned up HOT 1
- Websocket trying to reconnect every 30 seconds HOT 1
- AtmosphereResource getting removed from resources list permanently while using Transport.SSE. HOT 3
- Websocket Closing Connection Again and Again HOT 1
- HTTP/3 WebTransport API
- JDK17 breaks working Atmosphere HOT 1
- Long-polling requests show XML parsing syntax error in Firefox console HOT 1
- "org.atmosphere.container.Jetty9AsyncSupportWithWebSocket" does not exist HOT 1
- Is there any security concerns because of query string in request URI
- NPE in AtmosphereRequestImpl because of race condition HOT 1
- NPE in AtmosphereRequestImpl.wrap
- JSR356Endpoint dropping custom attributes on the HTTP request HOT 8
- Double string length prepended to cached heartbeat messages HOT 2
- Missing handshake session leads to NPE in Jetty HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atmosphere.