I'm developing a service in flex which requires realtime invalidations and I was wondering which is the recommended method to add realtime support to Flex applications (any change to data models should be reflected to all subscribed clients).
Here are some concerns:
My server is written in python3 (tornado, sqlalchemy, redis) although I don't care adding another service written in other language as long at it is simple and not a resource hog (no java please :)). My client is written in Flex and this must be supported
I want to have multiple servers\processes to handle realtime
connections and I don't want to use sticky sessions (SPOF?). All of the processes will be behind a Load Balancer.
I don't
care about the transport method as long as it is not proprietary (no RTMP), it has fallbacks and it is well supported (mostly IE9 and above)
Currently, I use Tornadio2 and FlashSocket.IO but both are not maintained and not recommended.
I thought about using SockJS though It doesn't have Flex support (can I use it through the browser?), and it seems that beside FlashSocket.IO, there are no other libraries available. It should also be noted that this library doesn't have fallback capabilities.
During my research, I saw several relevant questions:
Real-Time communication between PHP and Flex application
Realtime update and Push Data in AS3
But they are 4 years old, and doesn't provide a good answer.
Any thoughts on the subject would be appreciated.
It seems that this topic is not hot (to say the least), but in case someone is interested, I managed to get around it by using SockJS on the flex html wrapper and communicating with it using external interface
I am doing something similar in Flex by using WebSockets (sockets.io) on the serverside. On the client side, I am using the AS3WebSockets library from https://github.com/theturtle32/AS3WebSocket
Works exceedingly well!
Related
I have started a crash course of IndexDB API. I have heard from the author that the API is a little bit confusing. Primarily, as we have been working with the promise pattern as this API doesn’t use this pattern. Secondary, there are different wrappers, one of them seems is from Github author’s personal library so I suppose he have created it.
However looking for a different flavor, I found this one: http://dexie.org/. Also supports the Promise pattern. See http://dexie.org/docs/Promise/Promise, http://dexie.org/docs/API-Reference#query-items . It seems “promising”.
Also I found that the IndexDB 2.0 API was created post the video time. It is already being supported since beginning of 2017. From a Mozilla developer, I found since Firefox 51 (Jan 2017) it is already there. And he wrote what’s the differences among 1 and 2 versions https://hacks.mozilla.org/2016/10/whats-new-in-indexeddb-2-0/
So my question is if at this point is better to use the wrapper libraries or to use the native IndexDB API in terms of cross-browsing and support and better practices?
It all depends on what you want to do with indexeddb -
If you are learning indexeddb for your interest or for knowledge then you should go for plain indexeddb. Learn and research as much you can, because it has too many apis and you will have to write code for every type of situation.
You want to use indexeddb in your project and dont have much time to explore indexeddb. You only want to do some database operations and release your project. In this case - you should go for indexedd library. This way you dont need to worry about indexeddb code . You will just write simple code using the library.
For instance : check out this article - https://dzone.com/articles/crud-operation-in-indexeddb-using-jsstore. How a library makes indexeddb so easy.
Hope this will help you.
Is possible to use QT QWebChannel without websockets, but using WebKit ICP?
I only found examples using webSockets.
Unfortunately, the documentation states that:
It works on all browsers that support Qt WebSockets, [...]. Additionally, a custom transport mechanism can also be implemented using Qt WebSockets to support Qt WebChannel-based communication.
It seems that you cannot use it without WebSockets, and it would explain why all the examples you find actually use them.
Anyway, it also states that:
The transport mechanism is supported out of the box by the two popular web engines, Qt WebKit 2 and Qt WebEngine (experimental).
Despite the fact that it is experimental, it looks like an alternative to the WebSockets.
Actually, while digging into the linked documentation, I've found that page where it is said about WebKit that it implements internally the required interface and it can be used in place of the WebSockets, but no example is provided.
You can find spare information all throughout the linked page, as an example it is said that:
For HTML clients run inside Qt WebKit, you can load the file via qrc:///qtwebchannel/qwebchannel.js. For external clients you will need to copy the file to your webserver.
Then, it follows a brief description of the steps to be done to achieve the same on those clients, as far as I understand by using no WebSockets in this case.
That said, It seems to me that the solution based on the WebSockets is the suggested one, so probably you should reconsider you architecture and use them. Otherwise, be ready to deal with experimental and poor documented features.
I'm writing an app using Ionic framework. I use mongodb as a datastore in the cloud but the lists are too comprehensive and is slowing the app down. After consuming millions of hours reading about client side storage I still dont have a clear answer.
I hoped it would be possible to serve these comprehensive json files native from the client, which is ios + android + windows phone but having not "server" to serve it that idea seemed to be a dud. Dont know if my limited understanding of the rest API in angular is at fault but logically that idea doesn't make sense.
Looking at on native sql clietn I investigated sqlite. Since sqlite implementation on these different platforms(ios + android + windows phone) will be a pain i looked at the different types of browser caching.
I dont want to go into to much detail but localstorage is to simple for my structures, and the other options are not being supported or deprecated. Its a mess. However, the two options regarding offline data solution i have found is Lawnchair and localForage.
What is the differences between these two as they provide the most comprehensive solution based on the client. Any one willing to suggest a beter / worse option.
Then there is the site files which i also want to cache using app cache but I'm not sure how to since I'm using https://www.npmjs.org/package/generator-ionic which is kick-ass by the way.
Lawnchair syntax is a bit more complicated than localForage and the project is no longer updated whereas localForage is (and it's developped by mozilla).
If you are using angular, then go with https://github.com/ocombe/angular-localForage which is my implementation of localForage for Angular, it will be really easy and you can force the driver you want to use if necessary (but on mobile local storage will never be choosen since all mobile smartphones support either websql or indexeddb).
I'd like to implement an application with Scala and HTML5. My idea was to create a "local" client-server architecture: Scala handles the calculations and generates HTML5 as a GUI.
To my mind there are two possibilities
Use a Java/Scala framework that allows embedded HTML5. SWT for example has a browser widget. JavaFX seems good, too.
Distribute the program with a server and run it in a browser on localhost.
It would probably be most convenient to require an internet connection and forget about the localhost. Unfortunately an offline mode is necessary.
Now I would like to know how to get this right:
The first option seems easier to implement but I wonder: How can I communicate with Javascript without the HTTP protocol ?
The second approach was just an idea. Have you ever done something like this ?
If you've got advice or know a good framework please go ahead.
UPDATE :
I've just had an interesting idea: Could I use nodejs to create something like a server-server architecture ?
Right now the communication between Scala and Coffescript seems like the most problematic part. I still wonder how I could initiate an update from the Scala side of the application. A HTTP Request is a nice way to exchange data. Sadly to my knowledge in "standard" Coffeescript there would be no event hook to listen to server-side HTTP messages.
I've thought about using nodejs to listen to the server-sent data. Is this a good idea ?
With regards to the second option, you may wish to investigate the Play! Framework or Lift. They automate a lot of the work required to make a web application in Scala, including handling AJAX requests.
Although I haven't tried packaging either for local use, there was an earlier Stack Exchange question about packaging Lift which might be relevant. It should be possible with Play! as well.
This is related to an earlier question I had asked about what sort of middleware one can use for developing a client/server app.
Among the options suggested, I was intrigued by zeroMQ and its capabilities.
Since morning, I have been researching on using zeroMQ for my application. However, since my client is a Adobe AIR/FLEX, I see a steep curve in using zeroMQ since there are no bindings available for actionscript.
Google search shows a popular client called STOMP that can be used for messaging in flex based applications but there doesn't seem to be any STOMP adapter for zeroMQ either.
This leaves me with other alternatives such as RabbitMQ or ActiveMQ (since they both seem to have STOMP adapters) as possible middleware choices.
How hard/easy it is to develop to stomp adapter for zeroMQ? I hardly found any documentation on writing an adapter. Or is it worth writing an adapter for zeroMQ than focus on, say, using RabbitMQ that supports STOMP.
Finally, what are other popular alternatives to STOMP for Flex on the client side and leverage zeroMQ on the middleware part.
Thanks
Dece
STOMP is probably going to be the only option from FLEX since it's by far the simplest MOM protocol available. Furthermore, since it's such a simple protocol, I'm surprised someone has not yet implemented a bridge from STOMP to zeromq.