Skip to content

Conversation

@systemed
Copy link
Owner

This provides a simple key/value store that can be accessed from Lua across threads. It's mainly intended for bringing in external data and config variables.

You can read data from file on the first call to init_function (which now has an is_first boolean), store values with SetData, and then access them with GetData afterwards.

The store is a string->string map. I did look at storing native Lua objects - it would have been nice to store tables! - but LuaRefs can't be shared across states, and deserialising an entire table every time way_function wants to look something up would be prohibitively slow.

@systemed systemed merged commit 0ebc1d7 into master Apr 17, 2025
5 of 7 checks passed
@systemed systemed deleted the kv_store branch April 17, 2025 09:59
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.

2 participants