Open KOLANICH opened 6 years ago
Wouldn't crossbar.io and the WAMP protocol already fit the bill ?
@ksamuel, is the handwritten schema and manual registration required? I mean that the usage of the lib should be transparent as if it is used in the same process.
You don't need to write schema. You do need registration, but it's one line. And honestly, it's preferable: you really don't want all your functions to be exposed to the network.
The call is not transparent as:
it requires await. Again, it's a good thing. You want this. Network calls are asynchronous by nature and blocking on this would limit your app to a few calls.
calling is call('name_of_function') and not name_of_function(). You can, however, create a 3 lines wrapper if that bother you.
However, it's pretty great:
Thank you. This would simplify the task. For the local use (as a way to avoid viral licenses restrictions with the look & feel the same as if a real lib was used) I'd prefer it be as transparent as possible, so it is possible to tinker a lib around it hooking everything needed to make it transparent.
Project description
A tool in python which wraps another library.
Use cases:
using GPL, LGPL and other libs with viral licenses in the apps with another licenses.May be illegal: FSF GPL FAQ opinion statesthough this opinion may be biased and I'm not a lawer.
Look & Feel
The tool contains of 2 parts sharing the same code: 1 a cli tool as a backend 2 a library as a frontdend
The library should add an import hook and have a set of modules imported through that lib. When a the hook is activated, it checks if the name asked to be imported is in the set, and if it is, it starts the backend and communicates to it via a shared memory page (in the case of local one) or via network. All the communication must be authenticated and optionally encrypted. The backend imports the library and allows the frontend which have started it to remotely execute code by sending special commands in a custom binary protocol. This protocol must have some comands to get values of variables.
The frontend creates a lazy object returning objects of special kind. When a user used any library functions which produce a value other than null (Note in the case of python) a pair of objects is created: the returned value on a backend and a proxy object on a frontend. When a method is called on a proxy object, the data is serialized and passed to backend. When a proxy object is used in a function on the frontend, the value is passed to frontend.
Relevant Technology