what do you mean? could you please provide an example
We have some python code running on a machine outside of backendless doing some object tracking and we want to send that data to the backendless. Currently we are using the api to send that to the database, from there we are running a timer from the frontend to poll the backend every second to get that data from the DB to the frontend. It’s rather inefficient.
It also fills up the DB with un needed data
I see,
well, for sending PUB-Sub messages there is a REST API General API - Backendless REST API Documentation
but with Commands, it’s a little bit complicated because it uses a different approach through sockets and to implement it you will need to replicate the client SDK RT-Client/scope-connector.js at master · Backendless/RT-Client · GitHub
Pub/Sub will be fine… I’ll get my code developer to look at those docs tomorrow. Thank you again!
Sorry I have one more question, can I run a Pub/Sub listener in the backend. I see the options are available but if I start a listener in an API call will it persists after the api call has returned?
no, once tasks are completed the worker will be removed.
using RT Listeners in the CloudCode can make sense only for fast notifications, for instance,
- you subscribe to a channel X command and create a promise which will be resolved only when you receive an X command
- then you send a Y command to the channel
- if someone responds to you in a few seconds the promise will be resolved, but if it takes more time the cloud code worker will be destroyed by timeout