microsoft / microsoft/vs-threading

Non-generic AsyncLazy for lazy initialization with side effects rather than a return value

Open
#194 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
1k
Forks
160
Avg merge
1d 12h
Merged PRs (30d)
28

Description

We occasionally use AsyncLazy<object> and return null from the value factory as a means for async, thread-safe lazy initialization of objects. Defining a non-generic version of AsyncLazy would feel better than returning null from a value factory.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing AsyncLazy entry point and review how its generic value factory handles asynchronous, thread-safe initialization. Define the non-generic behavior for factories used only for side effects, then verify that the new API supports those call sites without returning null; the issue does not name specific files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.