You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StephenCleary edited this page Sep 5, 2014
·
1 revision
Overview
Task constants provide pre-constructed constant task values. These are effective when using the async fast path.
API
publicstaticclassTaskConstants{// A task that has been completed with the value "false".publicstaticTask<bool>BooleanFalse{get;}// A task that has been completed with the value "true".publicstaticTask<bool>BooleanTrue{get;}// A task that has been completed with the value "-1".publicstaticTask<int>Int32NegativeOne{get;}// A task that has been completed with the value "0".publicstaticTask<int>Int32Zero{get;}// A task that has been completed.publicstaticTaskCompleted{get;}// A task that will never complete.publicstaticTaskNever{get;}// A task that has been canceled.publicstaticTaskCanceled{get;}}publicstaticclassTaskConstants<T>{// A task that has been completed with the default value of "T".publicstaticTask<T>Default{get;}// A task that will never complete.publicstaticTask<T>Never{get;}// A task that has been canceled.publicstaticTask<T>Canceled{get;}}