Skip to content

Commit

Permalink
Refactored by renaming variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbywater committed Nov 9, 2019
1 parent e3046e1 commit 5fba6fa
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions eventsourcing/application/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def call_policy(self, domain_event):
fifo = deque()
fifo.append(domain_event)

all_domain_events = []
pending_events = []

while len(fifo):

Expand All @@ -328,14 +328,12 @@ def call_policy(self, domain_event):
all_aggregates += new_aggregates

# Collect pending events.
domain_events = self.collect_pending_events(all_aggregates)
generated_events = self.collect_pending_events(all_aggregates)
pending_events.extend(generated_events)

# Enqueue generated events.
if self.apply_policy_to_generated_events:
# Enqueue generated events.
fifo.extend(domain_events)

# Extend 'new events' with these generated events.
all_domain_events.extend(domain_events)
fifo.extend(generated_events)

# Translate causal dependencies from version of entity to position in pipeline.
causal_dependencies = []
Expand All @@ -359,7 +357,7 @@ def call_policy(self, domain_event):
)

return (
all_domain_events,
pending_events,
causal_dependencies,
repository.orm_objs_pending_save,
repository.orm_objs_pending_delete,
Expand Down

0 comments on commit 5fba6fa

Please sign in to comment.