Lodestone-Team / lodestone_core

The backend for Lodestone, A free, open source server hosting tool for Minecraft and other multiplayers
https://www.lodestone.cc/
GNU Affero General Public License v3.0
59 stars 7 forks source link

Provide an API to control instances in the 'main' runtime #171

Closed CheatCod closed 1 year ago

CheatCod commented 1 year ago

Preliminary

Problem

If an instance is started within a task runtime, and since the runtime is destroyed by the end of the task's lifetime, this makes any subsequent access to that instance from the main runtime invalid.

Solution

The solution is to have all instance operation call execute in the 'main' runtime. To achieve this:

CheatCod commented 1 year ago

having the thread enter the main runtime solves the issue