-
Notifications
You must be signed in to change notification settings - Fork 936
/
Copy pathIFutureValue.cs
25 lines (23 loc) · 937 Bytes
/
IFutureValue.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Threading;
using System.Threading.Tasks;
namespace NHibernate
{
/// <summary>
/// An object allowing to get at the value of a future query.
/// </summary>
/// <typeparam name="T">The type of the value returned by the query.</typeparam>
public interface IFutureValue<T>
{
/// <summary>
/// The value of the future query. If not already resolved, triggers all pending future query execution.
/// </summary>
T Value { get; }
/// <summary>
/// Asynchronously get the value of the future query. If not already resolved, triggers all pending future query execution.
/// Otherwise, this synchronously returns the already resolved value.
/// </summary>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work.</param>
/// <returns>The value of the future query.</returns>
Task<T> GetValueAsync(CancellationToken cancellationToken = default(CancellationToken));
}
}