real time update with SQS in Flask - ajax

I have a python script with reads data from an external API, formats it and pushes to dynamoDB for storage and to SQS.
I have a Flask web application. I want this Flask application to read the messages from SQS and update the main page in real time without page refreshes.
Do I need to use another service like Celery to achieve this? People talk about web sockets or AJAX? Does anyone have a simple example?
There is also this service called Pusher which handles it for you apparently?
Update: I managed to get it to work with pusher but it's really slow
Thank you!

I was able to solve the problem with the service called pusher
It basically takes care of the websockets for you. Very easy to use.
Hope this helps anyone who experiences the same problem

Related

Is it posible to broadcast Laravel events to Socket.io without Redis?

Good evening, programmers!
I have an issue with my program. There are several restrictions to my environment, so I cannot use Redis in it as well as Pusher. But I have to build realtime application. So, my very last alternative is socket.io.
I want to use Laravel Broadcasting System to notify my socket.io on events and after that - notify frontend part of my application with this events.
How could I do that and may be are there some packages to do this job? I will appreciate for any help!
Sure you can. Memcached might be something for you to look into.

Deploy Hubot on AWS Lambda?

I'm a noob using Hubot, so please bear with me.
I was going through Hubot's documentation ( https://hubot.github.com/docs/deploying/ ) and saw that we can deploy to Heroku, Unix systems and others.
May I know how can Hubot be deployed on AWS Lambda ?
Best Regards.
I was wondering the same thing. I think the answer is probably "yes, if your chat system can send you http when traffic happens". I think Lambda is probably a great choice, since each message in chat is an event to process according to the rules that your bot has. So, the Lambda function invocation model is a good fit - lots of tiny invokes. You might, though, want to filter the traffic that gets to the function, though, if your chat system is high-traffic.
For example Slack's Events API lets you subscribe to all of the things you might need the bot to see, I think. You'd then need to route those requests to your lambda function, which you could do via AWS API Gateway.
The existing hubot-slack adapter uses the Real-Time Messaging API, though, so you'd need to write your own adaptor for the Events API http that the API Gateway receives.
The same approach (and requirement) applies to other chat systems.

Logging user interactions with a program

We have an app and we want to log how the user is interacting with it. For example are they using the pages we expect them to. I dont want to log this via the app as it will be very hard for me to then get this information from the device. Each page interacts with webservices so I was planning to log that interaction.
I have had some thoughts on this
* as the webservice is being called add a logging table to the database - problem here could be performance impact
* use log4j async mode to log these details.
Does anyone have any other suggestion on how to do this? Im reading the Lean Startup at the moment (very good so far) and this sort of thing seems fundamental to it so Im wondering if there are any other tips to this.
Thanks
Since no one answered this for a couple months, I thought a couple pointers might help you...
Use mobile analytics tools
Fabric.io
Google Analytics for Mobile Apps
Flurry
Amazon Mobile Analytics
appsee
Have the server record what users access (that's the approach you're considering). To offload the overhead, there are a couple tactics you could employ (mix 'n match as you will):
Use async mechanisms (async operations in the server, such as Futures; log4j async mode; async databases; etc).
Use a separate database.
Use a NoSQL database only to write accesses. Later on you process that information in a separate analytics application.
Have the client (mobile app) record the actions and send them in bulk to the server once in a while (as frequently as you need / want / can afford).
Cheers

Realtime notification using signalR

I am new to SignalR. I am hoping to integrate SignalR to send notification in dashboard (i.e. latest applications created by staff) so that new applications will be shown without refreshing the dashboard. Applications should be fetched from a database (sql server) and notified to the dashboard. Is there any sample that I can look in to and take some idea how to start on this? Any help is highly appreciated.
Regards
Samitha
Sounds cut and dry. You want to create a Hub which your dashboard clients can connect to to receive updates. Then either the Hub itself could have a monitoring routine (e.g. background thread that is watching some stream of events from some external resource) that is pushing out updates to the connected clients.
Alternatively you could go with a better separation and just have the Hub be "dumb" and move the monitoring/notification off into another background process which just connects to the Hub like any other client and just pushes its notifications to the other clients through the Hub.
I would highly recommend just reading the Wiki and taking a look at some of the samples that come with the SignalR solution.

notify client browser about changes on server

I am trying to make a simple chat-like application where each of the users share data. I need to somehow update all the clients with the new data in real-time when 1 of them is sending something.
Is there a way to do it, maybe a webserver or smt ? something that works on apache?
For the client page i am using ajax to send data to server and PostgreSQL database to store the datas, but idk how to 'tell' clients that they need to 'refresh' the client browser because 1 client sent new datas to server.
Thank you in advance, Daniel!
I don't know what technology you are using so I would just recommend have a look at this service http://pusher.com/. They are a paid service that gives you the functionality you need. If you give more information on your technology we could provide better help.

Resources