- 1 ms


runQueue :: CommitQueue -> Queue r -> IO r
runQueue queue = iterM run
  where
    run (Update repo commits k) = CommitQueue.updateRepoBacklog queue repo commits >>= k
    run (TryDequeue k) = timeout timeoutDelay (CommitQueue.dequeue queue) >>= k
    run (EmbedIO action k) = action >>= k

runQueue :: CommitQueue -> Queue r -> IO r
runQueue queue = iterM run
  where
    run (Update repo commits k) = CommitQueue.updateRepoBacklog queue repo commits >>= k
    run (TryDequeue k) = timeout timeoutDelay (CommitQueue.dequeue queue) >>= k
    run (EmbedIO action k) = action >>= k
runQueue queue = iterM run
  where
    run (Update repo commits k) = CommitQueue.updateRepoBacklog queue repo commits >>= k
    run (TryDequeue k) = timeout timeoutDelay (CommitQueue.dequeue queue) >>= k
    run (EmbedIO action k) = action >>= k