-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: The ability to serialize functions/closures #5514
Labels
Comments
how about shared data? func test() { x := 0 f := func() { x++ } // .. } if you serialize f in test() and send it to remote machine and execute it three times, should x in the origin machine change? i don't think we can implement this in the general case. please also consider the architecture of the remote machine might not be the same. |
In practice all the only values the make it back to the origin machine are those returned by the function. You can see this in practice at http://spark-project.org/ (Scala based). And python closure serialization can be found at http://pydoc.net/Python/cloud/2.3.9/cloud.serialization.cloudpickle/ As for machine architecture, distributed compute clusters tend to be homogeneous. If the architecture doesn't match, then an error could be returned. |
I can't see this ever being implemented in the language or the standard libraries. I can imagine specific implementations in specific packages, but they would not in general work with arbitrary functions, or they would only work when interpreted, not compiled. Status changed to Unfortunate. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by kellrott:
The text was updated successfully, but these errors were encountered: