Skip to content

Add FlushUpdates and events for players/saves debounced updates - #227

Merged
tudddorrr merged 1 commit into
developfrom
flush-debounced-updates
Aug 4, 2026
Merged

Add FlushUpdates and events for players/saves debounced updates#227
tudddorrr merged 1 commit into
developfrom
flush-debounced-updates

Conversation

@tudddorrr

@tudddorrr tudddorrr commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Debounced API overhaul

  • DebouncedAPI is now generic over TReturnData and TUpdateResult, enabling callers to receive typed results from debounced operations instead of fire-and-forget voids.
  • Player.SetProp, DeleteProp, and their array variants now return Task<PlayerUpdateResult>, letting callers await the outcome and inspect rejected props inline.
  • Talo.Saves.UpdateCurrentSave and DebounceUpdate now return Task<SaveUpdateResult> with the updated save on success.

Completion signals and flush support

  • Added OnPlayerUpdated(bool) and OnSaveUpdated(bool, GameSave) events that fire after each debounced settle, so UI can react without polling.
  • FlushUpdates() on both APIs drains any pending trailing calls and returns a FlushResult enum (NothingPending, Success, Failure).
  • TaloManager.OnApplicationQuit now flushes events, player updates, and save updates before the process exits, preventing silent data loss.

Sample and documentation updates

  • Playground SetProp sample now awaits the result and shows rejection reasons inline instead of relying on a global event listener.
  • Saves demo subscribes to OnSaveUpdated for save feedback instead of manually toggling button text after awaiting.

@tudddorrr tudddorrr added the enhancement New feature or request label Jul 22, 2026
@tudddorrr
tudddorrr force-pushed the flush-debounced-updates branch 3 times, most recently from 1390ec9 to f8ae6f9 Compare August 4, 2026 01:39
@tudddorrr tudddorrr added breaking This pull request contains a breaking change and removed enhancement New feature or request labels Aug 4, 2026
@tudddorrr
tudddorrr force-pushed the flush-debounced-updates branch from f8ae6f9 to 5490315 Compare August 4, 2026 19:13
@tudddorrr
tudddorrr force-pushed the flush-debounced-updates branch from 5490315 to c65b010 Compare August 4, 2026 19:43
@tudddorrr
tudddorrr merged commit af738f5 into develop Aug 4, 2026
4 checks passed
@tudddorrr
tudddorrr deleted the flush-debounced-updates branch August 4, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking This pull request contains a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant