Skip to content

Commit

Permalink
Feat: helper function to await a certain seq value in MetaTables for …
Browse files Browse the repository at this point in the history
…projections
  • Loading branch information
mindreframer committed Sep 13, 2024
1 parent 3833546 commit 4c403cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/projections/seq_checker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ defmodule Essig.Projections.SeqChecker do
Checks, that given Cast modules reached certain SEQ value
"""

import Liveness

def await(modules, seq, timeout \\ 250) do
eventually(fn -> check_reached(modules, seq) == true end, timeout, 1)
end

def check_reached(modules, seq) do
conditions =
Enum.map(modules, fn module ->
Expand Down

0 comments on commit 4c403cb

Please sign in to comment.