Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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

Closed

Description

@incanus

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).

/cc @frederoni @1ec5

Activity

  1. added
    iOS
    macOS
    on Aug 15, 2016
  2. added this to the ios-future milestone on Aug 15, 2016
  3. 1ec5 commented on Aug 15, 2016

    @1ec5
    Contributor

    (Spun out from #5957.)

  4. 1ec5 commented on Aug 15, 2016

    @1ec5
    Contributor

    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.

  5. frederoni commented on Aug 17, 2016

    @frederoni
    Contributor

    Perfect case for the recently introduced class properties:

    @property (class) NSUInteger batchedTransactions;
    

    It's unfortunate that we can't make use of this yet as it would mean dropping support for Xcode 7.x

  6. jfirebaugh commented on Aug 21, 2016

    @jfirebaugh
    Contributor

    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).

  7. jfirebaugh commented on Sep 1, 2016

    @jfirebaugh
    Contributor

    Automatic batching is part of #6201, I'm going to mark this to close when that's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureiOSmacOSruntime styling

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions