There’s no mechanism to do that directly now. However, you can built it with the features available in the core at present.
To simply get a string back to a caller, what you could to is have a function that updates a String variable. So you’d first call the function via the cloud, the core updates it’s variable, and then you fetch the value of the variable from the cloud.
This works for simple cases where you just need an updated value, but not if you want to associate the value with a specific function call.
In that case, we need to get a bit more complex. Here, the function would increment a value, such as a counter and return that as the function result. That represents an ID for the unique function call. At the same time, the function posts an event name, like “update/” where the is the counter value returned by the function. The data for the published event is the string to deliver - the json string you posted above.
To get the value, a client does this:
- subscribe to “update” events from the core
- call the function and save the result as ID
- wait for a “update/ID” event to come (where ID is the function return value from 2.)
I hope that’s clear - I’m happy to elaborate where needed.