Release Notes for 474

Notes for Release 474

32 Likes

Client Difference Log

API Changes

Added Class MemoryStoreQueue : Instance [NotCreatable] [NotReplicated]
	Added Function void MemoryStoreQueue:AddAsync(Variant value, int priority = 0, int expiration = -1) [Yields]
	Added Function Tuple MemoryStoreQueue:ReadAsync(int count, bool allOrNothing = false, int waitTimeout = -1) [Yields]
	Added Function void MemoryStoreQueue:RemoveAsync(string id) [Yields]

Added Class MemoryStoreService : Instance [Service]
	Added Function Instance MemoryStoreService:GetQueue(string name, int invisibilityTimeout = 30)

Removed Function StudioTheme:GetPath

(Click here for a syntax highlighted version!)

19 Likes
Added Class MemoryStoreQueue : Instance [NotCreatable] [NotReplicated]
	Added Function void MemoryStoreQueue:AddAsync(Variant value, int priority = 0, int expiration = -1) [Yields]
	Added Function Tuple MemoryStoreQueue:ReadAsync(int count, bool allOrNothing = false, int waitTimeout = -1) [Yields]
	Added Function void MemoryStoreQueue:RemoveAsync(string id) [Yields]

Added Class MemoryStoreService : Instance [Service]
	Added Function Instance MemoryStoreService:GetQueue(string name, int invisibilityTimeout = 30)

This is huge. So many possibilities. I can’t wait to see what people create & how exactly MemoryStores will work. Keep up the great work!

5 Likes

:heart: Appreciate the detail, that’s one heck of a way to say that my players are going to be able to see underwater.

18 Likes

I’ve been asking for this since 2019 and I’m unbelievably happy that engineers have listened and are close to implementing a solution. Examples like this continue to make me excited to develop games on the platform.

In a game like SharkBite where a user can spend a whole round underwater this is going to be such a game changer, and was the only thing blocking me from continuing.

4 Likes

This API was way too confusing for me to look at for some reason, I really didn’t understand what most of that stuff was for a good minute while I tried to figure it out. If anyone else doesn’t get what this is, I think I’ve got a good idea now.

MemoryStoreService:GetQueue() returns a MemoryStoreQueue by a name to identify it. This is like the name of a DataStore.

MemoryStoreQueue:RemoveAsync() removes a value by its id, which, I assume is accessible via MemoryStoreQueue:ReadAsync(). I would think that the regular use case would be to read all of the entries in the queue and convert them into some sort of data structure, e.g. a list, and, then you’d process things that way.

MemoryStoreQueue:AddAsync() adds a value to the queue. I assume the priority determines where in the queue it will appear. If you use priority 1, I would assume that it appears at the beginning over priority 0 items. That’d allow you to have different groups of data. The expiration time I would expect automatically removes the item from the queue.

Lastly, I believe MemoryStoreQueue:ReadAsync() reads in count number of entries. I would expect allOrNothing will return nil or fail if the count isn’t reached, so, if you expect 10 items but there’s only 9 it won’t give you anything back or it might throw an error. The wait timeout I would assume decides how long to wait before failing. For example, if there are no values it might just return nothing after that timeout, or, if you use allOrNothing it would likely only return nothing if the count isn’t reached by that timeout time. I would expect that the results you get back keep the priority of the entry, and, of course, the id of the entry must be there too.

With allOrNothing off, I would expect that with an infinite timeout time ReadAsync reads up to the count you specify but will wait until any values are in the queue. With allOrNothing on I would expect that it permanently waits until the count is reached.

That’s how I’m guessing that API will work, and, its probably one of the most confusing APIs I’ve seen when you don’t have the docs for it yet (which certainly isn’t a bad thing)

3 Likes

MemoryStoreService for Parallel Lua, perhaps?

2 Likes

I believe this is both shared memory and for parallel lua. I may be wrong, they might be separate things.

3 Likes