You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
allow for more efficient batch runtime style API changes #6017
We want a transaction block model such as CATransaction which will defer calls to -[MGLBaseStyleLayer update] until the transaction is completed, allowing for many setters to be called which are all made effective with one -update call.
A model for design here might be a singleton which counts to 1 when the transaction begins, decrements to 0 when the transaction commits, and throws an exception if it is ever tried to be nested with a secondary or later begin (though, that would probably be harmless—commit could just always reset to 0).
A model for design here might be a singleton which counts to 1 when the transaction begins, decrements to 0 when the transaction commits, and throws an exception if it is ever tried to be nested with a secondary or layer begin.
With a block-based design, we can allow the counter to increment past 1 and only update when it falls to 0. Nesting transactions should be no problem.
I don't think we want an explicit transactional API; we had that in gl-js but replaced it with automatic batching, which works well and requires less API surface area (mapbox/mapbox-gl-js#2355).
Activity
1ec5 commentedon Aug 15, 2016
(Spun out from #5957.)
1ec5 commentedon Aug 15, 2016
With a block-based design, we can allow the counter to increment past 1 and only update when it falls to 0. Nesting transactions should be no problem.
frederoni commentedon Aug 17, 2016
Perfect case for the recently introduced class properties:
It's unfortunate that we can't make use of this yet as it would mean dropping support for Xcode 7.x
jfirebaugh commentedon Aug 21, 2016
I don't think we want an explicit transactional API; we had that in gl-js but replaced it with automatic batching, which works well and requires less API surface area (mapbox/mapbox-gl-js#2355).
jfirebaugh commentedon Sep 1, 2016
Automatic batching is part of #6201, I'm going to mark this to close when that's merged.