Skip to content

Scoped services #149

@davidwengier

Description

@davidwengier

It would be awesome if at the start of every frame, instead of taking a snapshot of IPixelMapper, and tell IImageCache to suspend stuff, we could instead have something like:

  • Call DI.ServiceLocator.BeginScope() in a using
  • The DI calls Clone() or every service that is needed
  • A scope with cloned services is returned from BeginScope()
  • The renderer instances etc. all come from that scope
  • At the end of the frame the scope is disposed
  • When the scope is disposed, it tells the services, so they can pass state to their parent implementations as necessary (ie, IImageCache)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions