Closed miketheprogrammer closed 9 years ago
Correction: We dont know if we are going to build this into the core.
Is this what was talked about in gitter? Where we determined that a simpler solution for this would be to write your handlers in go and access them directly from the application's js?
By JS you mean JSON ?
I'm referring to javascript, not json. Assuming the content of the thrust-powered application is standard web content, you can simply use javascript to communicate with the go backend like you would any other http server. And then the existing go libraries/methodologies would be able to tie in as if you're writing a normal webserver.
The biggest possibility I see for thrust helping this process is having thrust provide a way for the application to know where the backend is "located", perhaps. Attaching an object to window
that defines properties the backend can set.
I'm adding a remote objcect in the main javascript context to send and receive message with the backend app
As spolu mentioned, "remote" in Thrust, available to the frontend, will allow us to do rpc. Closing. Reopen as Implement Remote ticket when new version is released
We need an RPC Bridge. This may possibly require a rewrite to the structure of the Bindings(menu, window, session), allowing channels to be returned. I am not sure if this is the best route yet.
Another method would be to Register the RPC module with the Dispatcher, and allow the dispatcher to dispatch to the Frontend, and allow the frontend to handle any reactions there.
Current Working Branch: https://github.com/miketheprogrammer/go-thrust/tree/package/web_jsonrpc