Skip to content
Snippets Groups Projects
Commit 639cd07d authored by Erik Johnston's avatar Erik Johnston
Browse files

Add comment

parent af03ecf3
Branches
Tags
No related merge requests found
...@@ -164,6 +164,14 @@ class Linearizer(object): ...@@ -164,6 +164,14 @@ class Linearizer(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def queue(self, key): def queue(self, key):
# If there is already a deferred in the queue, we pull it out so that
# we can wait on it later.
# Then we replace it with a deferred that we resolve *after* the
# context manager has exited.
# We only return the context manager after the previous deferred has
# resolved.
# This all has the net effect of creating a chain of deferreds that
# wait for the previous deferred before starting their work.
current_defer = self.key_to_defer.get(key) current_defer = self.key_to_defer.get(key)
new_defer = defer.Deferred() new_defer = defer.Deferred()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment