Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit 4d5f71b

Browse files
committed
fix(Repository): LightLazy made obsolete.
At a later date we should remove it from code altogether. Relates to #104.
1 parent c1e6eee commit 4d5f71b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Liquid.Repository/LightLazy.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44

55
namespace Liquid.Repository
66
{
7+
/// <summary>
8+
/// Specialization of a <see cref="Lazy{T}"/> that calls the valueFactory on a Task.
9+
/// </summary>
10+
/// <typeparam name="T">The type of the object that is lazyly produced.</typeparam>
11+
/// <remarks>
12+
/// Made obsolete since there are issues with this type.
13+
///
14+
/// There's a conceptual issue here - lazy objects are be loaded at the last minute, when necessary. This
15+
/// Lazy values are supposed to be loaded once, "just in time", and then available in memory.
16+
/// This implementation brings the extra effort of having to always await on a type that will
17+
/// almost always be available, which is a overhead that we should avoid.
18+
/// </remarks>
19+
[Obsolete("Use System.Lazy instead.")]
720
public class LightLazy<T> : Lazy<Task<T>>
821
{
922
public LightLazy(Func<T> valueFactory) : base(() => Task.Factory.StartNew(valueFactory))

0 commit comments

Comments
 (0)