Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Feature Request: Trigger Function Execution From Client #212

Open
BlueMilkApps opened this issue Jun 1, 2017 · 1 comment
Open

Feature Request: Trigger Function Execution From Client #212

BlueMilkApps opened this issue Jun 1, 2017 · 1 comment

Comments

@BlueMilkApps
Copy link

Goals

Fire a Realm Function based by calling it directly from the Realm client. Node.js can obviously do this, so it would require opening it up and some modification to the client libraries to enable such a call. This is useful for doing various non-Realm things, like going and getting data from some API (weather, financial, heath, etc...). I realize you can do this by using some intermediary realm objects now, but it feels like an extra step for simple requests.

Expected Results

Call something like SyncUser.current.execute("nameOfFunc", args:(string/object or something)). The function would then kick off server-side, do it's async thing, and return JSON.

@bigfish24
Copy link

@RiverbayChris thanks for filing this. We have explored formalizing an RPC pattern and will take this feedback as a reason to continue. Don't have anything to share just yet, since you obviously realize that you can set this up already via objects.

Such as creating a class just for communicating: RequestObject that might have a payload String property. Your Realm Function could listen to all of the users Realms that create these objects, such as making a dedicate /~/requests Realm and react to the insertions. An additional data property response on the object could be filled in by the server and a boolean property status could be used to communicate inProgress or completed.

Obviously formalizing this could help reduce the boilerplate and make this more straightforward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants