Skip to content

Commit

Permalink
add throw by error flag in sync projectionist wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBadura committed Jan 10, 2024
1 parent b60f718 commit 893bd18
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function __construct(
private readonly EventBus $parentEventBus,
private readonly Projectionist $projectionist,
private readonly LockFactory $lockFactory,
private readonly bool $throwByError = false,
) {
}

Expand All @@ -29,7 +30,7 @@ public function dispatch(Message ...$messages): void
}

try {
$this->projectionist->run();
$this->projectionist->run(throwByError: $this->throwByError);
} finally {
$lock->release();
}
Expand All @@ -43,6 +44,7 @@ public static function createWithDefaultLockStrategy(EventBus $parentEventBus, P
new LockFactory(
new FlockStore(),
),
true,
);
}
}

0 comments on commit 893bd18

Please sign in to comment.