I'm playing around with getstream.io, it's an amazing tool but I have a question regarding realtime updates.
I am connected to realtime updates of a feed via Javascript (simply following examples from getstream.io).
feed.subscribe(callback)
Which works beautifully, adding and removing activities to the feed triggers the callback function.
However if I (via python) update an activity of a feed.
e = feed.add_activity(editable)
e['content'] = 'Ooops'
client.update_activity(e)
I see that the update was successful if I call feed.get() but I don't get a realtime notification in Javascript, shouldn't I? Am I doing something wrong?
The activity update API does not trigger a real-time update notification.
Related
I am building a conversational voice bot with Twilio and Node.js. Whenever a call ends, I need to send collected data(collected in Twilio autopilot Memory object) to a database. If the user completes the entire question-answer session with the bot, I am able to send the data to a DB. But if the user hangs up the call in between, the execution of functions stops completely. To handle this, I am triggering a function(called callEnd.js) execution on call-end using 'CALL STATUS CHANGES' in the Twilio console. But the event object provided in callEnd parameter does not contain the Memory object. How do I handle this?
My objective is to push partially collected/full collected data to DB.
Twilio developer evangelist here.
If your questions are distributed over several functions and you want to permanently store the collected data no matter how far through the conversation the user gets, then I recommend that you store the answers each time you receive a webhook from Autopilot updating your database with everything that is in event.Memory at that point.
That way your DB will collect the data and it doesn't matter how far the call gets, it will always have all the answers that the user provided.
hi guys I'm trying to add push notifications to my flutter app. I want them to be sent to specific users an hour before an event happens the time of the event will be stored in firebase by the user. I have been doing my research and I think need to write these conditions in a node.js file? I also want to send another notification if an entry is added which is pretty straight forward. However I only would want to send it to the users in the same area as the user who added the entry. In my flutter app I use geohashes and haversine to query firebase for the user in the same area would I need to do the same in the node.js file. I am having trouble finding some good examples if this correct please direct me to some better resources if not please help me better understand what I should be doing. Thank you
Your question's scope is wide but I will try to give you some kind of guideline for you to begin with.
First to set up an environment for firebase functions follow this, then there are different triggers for firebase functions like database write calls a function to be executed when new data is written to the database.
In your case when you add an event inside your trigger write some code to get the users near that area and send notifications, and to send the notifications you will need to get the token of every user when they login to your app and save it somewhere else.
For firebase functions, you need to know basic Javascript/TypeScript and for that, this video series of Doug Stevenson is very helpful. I recommend finishing the tutorial first.
I wonder if it is possible to fire a trigger after document is deleted from collection. To be more specific I'd like to be informed when a document expires.
I've seen that it isn't possible to catch deletes from change feed (https://learn.microsoft.com/en-us/azure/cosmos-db/change-feed) but then I've downloaded cosmosdb emulator and here I see an option to create a trigger that can be fired on deletes. What is the difference between triggers created by user as seen in emulator and triggers fired on change feed? Is there any chance I could get a trigger for my needs?
Currently there is no wait to archive what you want unless you use a server side post-trigger written in JavaScript.
However, in CosmosDB a trigger has to be explicitly called when the operation that will do the delete is invoked, which makes it less of a trigger and more of a stored-procedure-ish.
You can read more about that here: https://learn.microsoft.com/en-us/azure/cosmos-db/stored-procedures-triggers-udfs#post-triggers
Registered triggers don't run automatically when their corresponding operations (create / delete / replace / update) happen. They have to be explicitly called when executing these operations.
To learn more, see how to run triggers article.
I'm trying to get data from Acumatica on every Audit Insert. I tried RowPersisted event on Audit History Screen, but it's not working.
What I am trying to accomplish is
When Someone creates a AP or AR it writes down on Audit.
I need to get that data on real-time.
I used Push Notifications on 2017R2 Acumatica.
Attached it to a Webhook using NodeJS and modified data that I needed to constantly post Events created by Push Notifications to Slack. :) Thanks guys.
Just wondering about the best way to subscribe to my CouchDB data store, so that if a document in couch is updated, the KO view will also update (automagically). Is this something that's even possible?
Below is what I have so far, which simply get the user name from the user_info document.
$.getJSON('http://localhost/couchdb/user_info', function(data) {
var viewModel = ko.mapping.fromJS(data);
ko.applyBindings(viewModel);
});
Any help would be greatly appreciated!
CouchDB supports notifications when documents change: the changes feed.
You can poll the changes feed, with a ?since=X parameter to receive only updates since X.
You can also "long poll" the feed by adding &feed=longpoll. If there are no changes yet, CouchDB will receive your query but not answer until finally a change comes on.
Or, you can have a full COMET-style feed by instead adding &feed=continuous. That is similar to longpoll, however CouchDB will never close the connection. Every time a change happens, it will send you the JSON and then continue waiting.
Finally, you can be notified when anything changes in the database, or you can specify a Javascript filter to run on the server (&filter=designdoc/filtername). You will only receive notifications if the filter approves.
Have you looked at http://hood.ie/ it woks well. I'm also running hoodie as an os_daemons service from within my couchdb.
It's nice.