Skip to content

feat: allow asset updating at runtime#208

Open
CallumNZ wants to merge 1 commit intomainfrom
assetUpdate
Open

feat: allow asset updating at runtime#208
CallumNZ wants to merge 1 commit intomainfrom
assetUpdate

Conversation

@CallumNZ
Copy link
Copy Markdown
Contributor

@CallumNZ CallumNZ commented Apr 29, 2026

Proposed Changes

Changes proposed in this pull request:

  • Currently assets are initialised in memory at start up. This makes hot-reloading assets during local development impossible. This adds a function to update a specific file in the assets maps (asset map and map of hashes) at runtime.
  • Since it's now possible to write to the maps after initialisation, I've put a mutex on a struct containing the asset store, and do the appropriate lock on all exported methods that access the maps. Although the UpdateAsset function is not meant to be used in production, I've put the locking stuff just in case users make a mistake and call it in a production environment. It's a RWMutex so all reads are non-blocking, so should have minimal effect on speed of concurrent access.

Production Changes

The following production changes are required to deploy these changes:

  • None

Review

Check the box that applies to this code review. If necessary please seek help with adding a checklist guide for the reviewer.
When assigning the code review please consider the expertise needed to review the changes.

  • This is a content (documentation, web page etc) only change.
  • This is a minor change (meta data, bug fix, improve test coverage etc).
  • This is a larger change (new feature, significant refactoring etc). Please use the code review guidelines to add a checklist below to guide the code reviewer.

Code Review Guide

Insert check list here if needed.

@CallumNZ CallumNZ requested a review from junghao April 29, 2026 03:01
@CallumNZ CallumNZ force-pushed the assetUpdate branch 2 times, most recently from 469bde6 to b453e34 Compare April 29, 2026 22:43
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.

1 participant