Skip to content

feat: Add timeout arguments to WaitForData and Flush - #9

Merged
ericplane merged 2 commits into
ericplane:mainfrom
ryancundiff:main
Jul 27, 2026
Merged

feat: Add timeout arguments to WaitForData and Flush#9
ericplane merged 2 commits into
ericplane:mainfrom
ryancundiff:main

Conversation

@ryancundiff

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the server-side lifecycle/persistence APIs to accept explicit timeout controls for WaitForData and Flush, and updates the persistence implementation so WaitForData can reliably time out even when no further state transitions occur (e.g., under LoadFailurePolicy = "Wait" during prolonged outages).

Changes:

  • Add optional timeout parameter to Data.WaitForData / Persistence.WaitForData (default 60s) and enforce it via a deadline-based wait.
  • Add optional Timeout option to Data.Flush / Persistence.Flush (default 15s) by forwarding it to AwaitSave.
  • Add lifecycle specs covering the new timeout behaviors and update typecheck/docs to match the new API surface.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/TypeCheck.luau Updates typecheck usage to pass timeout to WaitForData and Timeout to Flush.
test/Specs/Lifecycle.spec.luau Adds tests ensuring WaitForData/Flush honor explicit timeouts and don’t hang.
src/Server/Persistence.luau Implements deadline-based waiting for WaitForData and forwards opts.Timeout through Flush.
src/Server/init.luau Updates server API signatures and docstrings for WaitForData(timeout?) and Flush({ Timeout? }).
src/init.luau Updates exported type definitions for WaitForData and Flush options.
README.md Updates example comment to reflect default timeout wording.
docgen/guides/lifecycle.md Updates lifecycle guide to document WaitForData(player, timeout?).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ericplane
ericplane merged commit b7cdff2 into ericplane:main Jul 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants