-
Notifications
You must be signed in to change notification settings - Fork 50
Implement free variable capture #36
Copy link
Copy link
Open
Description
Motivated by the use of module global variables, like logging.Logger instances, deco should be able to detect free variable reference in its concurrent functions and pass in/proxy any it encounters. This functionality should be optional, perhaps even allowing the specification of exactly which free variables to capture.
A simple test is the following:
from deco import *
global_var = False
@concurrent
def my_conc():
return global_var
if __name__ == '__main__':
global_var = True
result = my_conc().get()
print(result) #Should print True, but prints False unless using concurrent.threadedReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels