Closed benbot closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
magick-client | ✅ Ready (Inspect) | Visit Preview | Aug 31, 2023 1:55pm |
magick-docs | ✅ Ready (Inspect) | Visit Preview | Aug 31, 2023 1:55pm |
What Changed:
SpellRunners (the class that runs spells) can't really handle multiple spell runs at the same time. They are pretty stateful, so that causes race conditions to pop up and results in weird behavior from agents that are receiving many messages at a time.
This changes how the SpellManager gets SpellRunners to run spells. Before we had a mapping of SpellId -> SpellRunner, but now we have a mapping of SpellId -> Array
When we try to get a SpellRunner, we get the first "ready" runner in the array a spellId maps to. If we don't find one, we create a new SpellRunner and add it to that array.
This we we have an automatically growing pool of spell runners
In the future we'll probably want this pool to auto clean itself, but it's likely the SpellRunner abstraction won't stick around, so this should be good enough for now.
How to test:
Make a spell with 2 generate text nodes chained into each other. Hook that spell up to discord and send a ton of messages to it.
Observe that it eventually responds to all messages.