Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AtataContext static mode #78

Closed
YevgeniyShunevych opened this issue Sep 18, 2017 · 0 comments
Closed

AtataContext static mode #78

YevgeniyShunevych opened this issue Sep 18, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@YevgeniyShunevych
Copy link
Member

YevgeniyShunevych commented Sep 18, 2017

Support static AtataContext mode. Currently AtataContext.Current uses [ThreadStatic] backing field.

Add property to AtataContext with default true value:

public static bool IsThreadStatic { get; set; }

Thread-static mode - AtataContext.Current uses thread-static (unique for each thread) value. Is good for environment with parallel test execution.

Static mode - AtataContext.Current uses static (common for all threads) value. Is good for environment with asynchronous actions, but without parallel test execution.

Usage

If you need to enable static mode, in one-time set up method set the following:

[OneTimeSetUp]
public void SetUp()
{
    AtataContext.IsThreadStatic = false;
}
@YevgeniyShunevych YevgeniyShunevych added this to the 0.14.0 milestone Sep 18, 2017
@YevgeniyShunevych YevgeniyShunevych self-assigned this Sep 18, 2017
@YevgeniyShunevych YevgeniyShunevych changed the title AtataContext Static Mode AtataContext static mode Sep 18, 2017
YevgeniyShunevych added a commit that referenced this issue Sep 18, 2017
YevgeniyShunevych added a commit that referenced this issue Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant