mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 05:06:29 +00:00
Two way sync V0 (#282)
* Unfinished two-way sync API * In-memory two-way sync complete * Move PatchSet application into ChangeProcessor thread, where it can be synchronous * Stop InstanceMap's signals when a ServeSession terminates * Apply patch in ChangeProcessor * Feature flag * Fix error in ChangeProcessor due to wrong drop order
This commit is contained in:
committed by
GitHub
parent
26e2e81188
commit
a398338c02
@@ -20,6 +20,16 @@ function InstanceMap.new(onInstanceChanged)
|
||||
return setmetatable(self, InstanceMap)
|
||||
end
|
||||
|
||||
--[[
|
||||
Disconnect all connections and release all instance references.
|
||||
]]
|
||||
function InstanceMap:stop()
|
||||
-- I think this is safe.
|
||||
for instance in pairs(self.fromInstances) do
|
||||
self:removeInstance(instance)
|
||||
end
|
||||
end
|
||||
|
||||
function InstanceMap:__fmtDebug(output)
|
||||
output:writeLine("InstanceMap {{")
|
||||
output:indent()
|
||||
@@ -145,7 +155,9 @@ function InstanceMap:__disconnectSignals(instance)
|
||||
local signals = self.instancesToSignal[instance]
|
||||
|
||||
if signals ~= nil then
|
||||
-- In the general case, we avoid
|
||||
-- In most cases, we only have a single signal, so we avoid keeping
|
||||
-- around the extra table. ValueBase objects force us to use multiple
|
||||
-- signals to emulate the Instance.Changed event, however.
|
||||
if typeof(signals) == "table" then
|
||||
for _, signal in ipairs(signals) do
|
||||
signal:Disconnect()
|
||||
|
||||
Reference in New Issue
Block a user