Created
August 25, 2016 04:15
-
-
Save prologic/ed709a76db4f1d23e14c8311ea4d20a3 to your computer and use it in GitHub Desktop.
created by https://github.com/tr3buchet/gister
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/circuits/core/manager.py b/circuits/core/manager.py | |
index f3cc174..ebef32e 100644 | |
--- a/circuits/core/manager.py | |
+++ b/circuits/core/manager.py | |
@@ -838,10 +838,17 @@ class Manager(object): | |
event.waitingHandlers += 1 | |
self.unregisterTask((event, task, None)) | |
# First yielded value is always the task state | |
- task_state = next(value) | |
- task_state.task_event = event | |
- task_state.task = value | |
- task_state.parent = task | |
+ value = next(value) | |
+ if isinstance(value, GeneratorType): | |
+ event.waitingHandlers += 1 | |
+ event.value.promise = True | |
+ self.registerTask((event, value, task)) | |
+ elif isinstance(value, CallValue): | |
+ value.task_event = event | |
+ value.task = value | |
+ value.parent = task | |
+ elif value is not None: | |
+ event.value.value = value | |
# The below code is delegated to handlers | |
# in the waitEvent generator | |
# self.registerTask((event, value, task)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment