Closed bmcfee closed 9 years ago
Alternately: thread this through a context manager and pass state objects around the deformers.
Following up, this can probably be reduced to a simple pattern.
BaseTransformer.transform()
will acquire an initial state
object as a local context managerstate
objects will be passed into all deformers, including audio and metadata. This will make the transformer objects essentially stateless, which simplifies both parallelization and serialization.BaseTransformer._transform()
will then iterate over self.next(state)
, which encodes all state-updating logic.
Pro:
Con: