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

Await: asynchronous evaluation of sequence elements #205

Merged
merged 62 commits into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0944664
SelectAsync to asynchronously pair sequence elements with their proje…
atifaziz Oct 27, 2016
d36166c
Make second SelectAsync overload public
atifaziz Oct 27, 2016
1afd841
Fix test build
atifaziz Oct 27, 2016
122a905
Make SelectAsync like Select and streaming
atifaziz Oct 27, 2016
689c2d3
Source arg name
atifaziz Oct 27, 2016
e391074
Concurrency control
atifaziz Oct 27, 2016
fa2148e
Eager disposal of source
atifaziz Oct 27, 2016
1144ae3
SelectAsync is lazy so validate args eagerly
atifaziz Oct 28, 2016
b5b6f18
Cancellation support in case of error or early termination
atifaziz Oct 28, 2016
07578f8
Back to an async awaiter loop so thread can return to pool
atifaziz Oct 28, 2016
aa671d8
Merge branch 'master' into SelectAsync
atifaziz Feb 27, 2018
2b86eba
Exclude SelectAsync from .NET Standard 1.0 build
atifaziz Feb 27, 2018
bbe2daf
Fix arg validation to pass tests
atifaziz Feb 27, 2018
2854b07
Use nameof to get arg names
atifaziz Feb 27, 2018
403df2d
Use local function pattern for implementation
atifaziz Feb 27, 2018
34af1fd
Add remarks that order is not preserved
atifaziz Feb 27, 2018
6142ca1
Add remarks that a new task is used as the workhorse
atifaziz Feb 27, 2018
2b58508
Fix remarks section start
atifaziz Feb 27, 2018
b7fccc1
Merge branch 'master' into SelectAsync
atifaziz Feb 27, 2018
ce92ff3
eclint fix -nw
atifaziz Feb 27, 2018
88927b6
Proper paragraph formatting of remarks
atifaziz Feb 27, 2018
f3c1cf5
Refactor options and add one to preserve order
atifaziz Feb 28, 2018
e4681fe
Scheduler parameter no longer exists on SelectAny
atifaziz Feb 28, 2018
ffa4ef2
Null arg checking to pass broken tests
atifaziz Feb 28, 2018
225ad0c
Merge branch 'master' into SelectAsync
atifaziz Mar 1, 2018
69ea1dc
Move under experimental namespace
atifaziz Mar 1, 2018
67ef192
Rename `PreserveOrder()` to `AsOrdered()`
atifaziz Mar 1, 2018
bdc4a81
Add AsUnordered to counter AsOrdered
atifaziz Mar 1, 2018
70d5073
Add AsSequential as MaxConcurrency(1)
atifaziz Mar 1, 2018
b8104c4
Remove redundant arg checks
atifaziz Mar 1, 2018
655e45a
Complete the documentation
atifaziz Mar 1, 2018
bb8e544
Make exception throw case clearer
atifaziz Mar 1, 2018
e3c4259
DelegatingComparer is redundant with Comparer.Create
atifaziz Mar 1, 2018
d6269f5
Fix typo in comment
atifaziz Mar 1, 2018
33e437a
Extract async result collection into own method
atifaziz Mar 1, 2018
90acfbe
Strong-typed notices
atifaziz Mar 2, 2018
acaa9cb
Merge branch 'master' into SelectAsync
atifaziz Mar 2, 2018
0da4625
Remove syntactic redundancies
atifaziz Mar 2, 2018
d7207d2
Better names
atifaziz Mar 2, 2018
466a74b
Remove empty line
atifaziz Mar 2, 2018
c241fb0
Reduce indentation
atifaziz Mar 2, 2018
7560944
Replace KeyValuePair<,> with a couple
atifaziz Mar 2, 2018
e389cab
Fix indentation
atifaziz Mar 2, 2018
9d2d55d
Fix remark about AsOrdered in 2nd overload
atifaziz Mar 3, 2018
6dd9958
Remarks about partial consumption & cancellation
atifaziz Mar 3, 2018
60e5474
Clearer name for task element of tuple
atifaziz Mar 5, 2018
21314f4
MaxConcurrency(int) + UnboundedConcurrency()
atifaziz Mar 6, 2018
6e22d29
Eager disposals of enumerator in CollectToAsync
atifaziz Mar 6, 2018
811b956
Keep TupleComparer member parity with ValueTuple
atifaziz Mar 6, 2018
e377fdb
Don't continue our awaits on captured context
atifaziz Mar 6, 2018
3819d3d
Simplify first overload to an awaiter
atifaziz Mar 6, 2018
d2857e8
Rename to Await
atifaziz Mar 7, 2018
3efb94d
Revert "Rename to Await"
atifaziz Mar 7, 2018
09497dc
Rename SelectAsync to Await & update doc wording
atifaziz Mar 7, 2018
7c9273d
Fix doc typo
atifaziz Apr 5, 2018
3bcaa35
Doc remarks about effects of hot/cold tasks
atifaziz Apr 5, 2018
23c2ac9
Merge remote-tracking branch 'upstream/master' into SelectAsync
atifaziz Apr 5, 2018
551ffbb
Add Await to list of operators in package description
atifaziz Apr 5, 2018
aa9dc5d
Add Await to readme
atifaziz Apr 5, 2018
7cee7d4
Merge branch 'master' into SelectAsync
atifaziz Apr 9, 2018
de2d232
Add await to new ops list in release notes
atifaziz Apr 9, 2018
70edcbe
Mark Await as experimental in package metadata
atifaziz Apr 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions MoreLinq.Test/MoreLinq.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<WarningsNotAsErrors>618</WarningsNotAsErrors>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<DefineConstants>$(DefineConstants);NO_ASYNC</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MoreLinq\MoreLinq.csproj" />
</ItemGroup>
Expand Down
13 changes: 13 additions & 0 deletions MoreLinq.Test/NullArgumentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace MoreLinq.Test
using System.Diagnostics;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.Interfaces;

Expand Down Expand Up @@ -136,6 +137,7 @@ static object CreateInstance(Type type)
{
if (type == typeof (int)) return 7; // int is used as size/length/range etc. avoid ArgumentOutOfRange for '0'.
if (type == typeof (string)) return "";
if (type == typeof(TaskScheduler)) return TaskScheduler.Default;
if (type == typeof(IEnumerable<int>)) return new[] { 1, 2, 3 }; // Provide non-empty sequence for MinBy/MaxBy.
if (type.IsArray) return Array.CreateInstance(type.GetElementType(), 0);
if (type.GetTypeInfo().IsValueType || HasDefaultConstructor(type)) return Activator.CreateInstance(type);
Expand Down Expand Up @@ -213,6 +215,17 @@ public System.Linq.IOrderedEnumerable<T> CreateOrderedEnumerable<TKey>(Func<T, T
}
}

#if !NO_ASYNC

public class AwaitQuery<T> : Enumerable<T>,
Experimental.IAwaitQuery<T>
{
public Experimental.AwaitQueryOptions Options => Experimental.AwaitQueryOptions.Default;
public Experimental.IAwaitQuery<T> WithOptions(Experimental.AwaitQueryOptions options) => this;
}

#endif

public class Comparer<T> : IComparer<T>
{
public int Compare(T x, T y) => -1;
Expand Down
Loading