Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature_request: return wrapped cached object on which methods of cached object can be directly called, and executed in server #13

Open
tkmmark opened this issue Nov 5, 2020 · 6 comments

Comments

@tkmmark
Copy link
Contributor

tkmmark commented Nov 5, 2020

Create a easy-to-work with wrapped cached object on which methods of the cached object (which may call all the nice scientific libraries we cannot use in IronPython) can be directly called--triggering their execution in the server.

An example of how it would be used from the point of the Proxy-using developer:
image

This involves creating a wrapped cached object that gets returned when Proxy.cache(object) is used:
image
This class, as can be seen, gathers and wrap all the methods that are in the cached object's class, so that they may directly be called from the Client side...

Where proxy.run_method_of_cached was discussed in an earlier Issue...

Finally, the wrapped object also provides a handy restore function that allows the cached object to be recreated in the client side.

@tkmmark tkmmark changed the title feature_request: return wrapped cached object on which methods of cached object can be directly called, and loaded in server feature_request: return wrapped cached object on which methods of cached object can be directly called, and executed in server Nov 5, 2020
@Licini
Copy link
Collaborator

Licini commented Nov 16, 2020

Hey @tkmmark , sorry for the late response, finally have some time to look at this properly. This looks pretty good to me! Actually would you mind to submit this part of code as a PR to compas_cloud ? I'm sure this will be a very useful feature

@tkmmark
Copy link
Contributor Author

tkmmark commented Nov 16, 2020

Yes, and thanks for asking earlier on slack as well.
Will submit a PR for sure.
Made some big changes, so I just need to make sure that the other examples still work, do some clean up, and see if there is a more pythonic (and proper) way to set this up using metaclasses or/and class decorators.

@tomvanmele
Copy link
Member

don't use ABC's on the client side because they create memory leaks in ironpython...

@tkmmark
Copy link
Contributor Author

tkmmark commented Nov 25, 2020

Had to make sure it works for properties as well, and other non-COMPAS structures...
Will wrap it up very soon and send a pull request.

image

@juney-lee
Copy link

@tkmmark Please follow up with the pull request, if still relevant.

@tkmmark
Copy link
Contributor Author

tkmmark commented Oct 7, 2022

I will follow up with Li Chen,
I gave him access to my fork for inspection a while ago because there were a number of changes.

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

No branches or pull requests

4 participants