13 ms·
Seems like the extreme version of this would be a simple annotation in client code to run it on the server, like the old <script runat...> in ASP, e.g. Java ps
by cromwellian 9y ago
Seems like the extreme version of this would be a simple annotation in client code to run it on the server, like the old <script runat...> in ASP,
e.g. Java pseudo code
@RunAt(Platform.SERVER)
public Observable<List<Customer>> findCustomersByName(String name) {
return // code to query DB and return a list of customers over the wire
}
// on client
public void searchByCustomer(String name) {
// findCustomersByName() and bind stream to UI
}
The idea being that the RPC is automatic here. The client code makes an async call, constructs an observable around deserialized result. The server code is pulled out by and spun up as a cloud function on demand. Of course this only makes sense if the code needs to run on the server (e.g. the results are big and need to run a lot of code, or need to run code that can't be trusted on the client).
- dualogy 9y ago> like the old <script runat...> in ASP Good memories! I remember how neat I found that as a script-kid back in the pre-.NET, VBScript-based ASP 3.0 days some 17 years ago. (MS Personal Web Server for the Win! The QBasic of the early web age.) But there wasn't any code-sharing and it was always clearly server-code, not client-code. Let alone the fact that only IE could run VBScript on the client..