Skip to content

What is Local context #804

Open
Open
@DGDarkKing

Description

@DGDarkKing

I tried find examples but attempts were unsuccessful

How I understand:
Singleton - One object of all container lifetime
ThreadSafeSingleton - Same as Singleton and thread safe

ContextLocalSingleton - What did you mean by Local context
ThreadLocalSingleton - Same as ContextLocalSingletonby but thread safe

After practice research - this are look like simple Singleton or ThreadSafeSingleton

I understand a local context as creation singleton object by "with" statement.
Found reset_singletons method for container and returns SingletonResetContext is usage in "with" statement. But the method reset all singletons: Singleton, ContextLocalSingleton etc.
And singletons reset both in context and in source container.
The reset make inside a "with" statement and again after it for every singletons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions