I have two Google Cloud Endpoints methods which I would like to communicate. Method 1 sends off a notification and waits a maximum of 30 seconds for a reply, and Method 2 receives replies and should pass them on to the listener in Method 1. What is the best way to do this? I could use the database, but I feel like storing an object in a database for 30 seconds and then deleting it is not the best way to accomplish this. I am looking for a simple way to send a message from one method to another, just like a simple string saying "Notification received a reply", nothing more.
Thanks in advance.
Related
I am implementing google smart home actions for my device. The device is a camera with the action.devices.traits.CameraStream. I want to know what is the best way to respond to the action.devices.commands.GetCameraStream command asynchronously.
Currently, once my server receives this command, it needs to notify the device and wait for the device to start streaming. Then the server can respond to google with the cameraStreamAccessUrl. This is not ideal because the server is being blocked and exactly how it knows the device has started streaming is a bit tricky. I am wondering if there is a better way to achieve this, for example, the server can respond immediately with some sort of deferred response and have the device tell google what the cameraStreamAccessUrl is.
Is this possible? Thanks for your help!
It sounds like you're trying to find something like follow-up responses to asynchronously notify the stream has started. Unfortunately, CameraStream does not currently support follow-up responses, but you could file a feature request on the public tracker.
Suppose we have a user uploading something like photos, and let's say that 20 photos get uploaded at the same time. Each of these photos would need to make a request to the backend to create them. That means that I might launch 20 requests at the same time which is a lot considering there can be other types of requests during this time.
What I want to accomplish with redux-saga is saga to put all these requests on a buffer and launch lets say 5 at a time, when a number out of the 5 are completed like 4 (in case 1 takes too long) saga should launch the rest. There is nothing on how you would accomplish this with the tools they offer. 'Throttle' offered by saga itself is not what I am looking for taking only the latest request of that type and just ignoring the others whilst I need it to save the others and fire them at a further date
There is no way to accomplish this without writing a custom module that does this management correct?
I'm using AngularJs on frontend and ExpressJs on backend and I would like to know the best way to manage real time notification.
I hesitate between using sockets(socket.io) or querying notifications every 5 seconds
What is the cleanest way to do it ?
This is exactly what socket.io is for.
You don't want to make unnessessary HTTP requests to query a notification endpoint every 5 seconds. Imagine this on a scale of 100 users. What about 1000 users?
socket.io lets you initiate communication on the server side without having to make a request from the client. Notify the client when the client needs to be notified.
Every minute or so my app creates some data and needs to send it out to more than 1000 remote servers via URL Fetch callbacks. The callback URL for each server is stored on separate entities. The time lag between creating the data and sending it to the remote servers should be roughly less than 5 seconds.
My initial thought is to use the Pipeline API to fan out URL Fetch requests to different task queues.
Unfortunately task queues are not guaranteed to be executed in a timely fashion. Therefore from requesting a task queue start to it actually executing could take minutes to hours. From previous experience this gap is regularly over a minute so is not necessarily appropriate.
Is there any way from within App Engine to achieve what I want? Maybe you know of an outside service that can do the fan out in a timely fashion?
Well, there's probably no good solution for the gae here.
You could keep a backend running; hammering the datastore/memcache
every second for new data to send out, and then spawn dozens of async url-fetches.
But thats really inefficient...
If you want a 3rd party service, pubnub.com is capable of doing fan-out, however i don't know if it could fit in your setup.
How about using the async API? You could then do a large number of simultaneous URL calls, all from a single location.
If the performance is particularly sensitive, you could do them from a backend and use a B8 instance.
How would I go about implementing a feedback function on a windows phone 7 app? I've considered creating a form that sends an email with the data to an address I own, but I wonder if there is a better solution.
I personally think the simplest and best solution is to use EmailComposeTask to send the feedback via email.
You could either just put some questions/suggested text in the Body - or you could fill the Body in with some information from a SL form.
One of the advantages of the EmailComposeTask is you will definitely get their email address to reply to. Another advantage is that the feedback will work even when there isn't currently a network connection - it'll just get added to the outbox for later processing.
Well, I would create a webservice that can receive that data. It could be useful in case you have a backend system that can make some data statistics.
You can refer to that post that contains some code about data sending to a web service: WP7 app never exits BeginGetResponse and goes into the callback function
Regards.