Skip to content

Commit

Permalink
Fixed naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jul 11, 2024
1 parent 9bb3533 commit e38245b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/DotNext.Tests/Threading/Tasks/TaskCompletionPipeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public static async Task WrongIteratorVersion()
[Fact]
public static async Task CompletedTaskGroupToCollection()
{
await foreach (var t in TaskCompletionPipe.GetCompletionStream([Task.CompletedTask, Task.CompletedTask]))
await foreach (var t in TaskCompletionPipe.Create([Task.CompletedTask, Task.CompletedTask]))
{
True(t.IsCompleted);
}
Expand Down Expand Up @@ -195,7 +195,7 @@ public static async Task CompletionTask()
var source1 = new TaskCompletionSource();
var source2 = new TaskCompletionSource();

pipe.Submit([source1.Task, source2.Task], complete: true);
pipe.Add([source1.Task, source2.Task], complete: true);

source1.SetResult();
source2.SetResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ public static Consumer<T> GetConsumer<T>(this TaskCompletionPipe<Task<T>> pipe)
public static Consumer<T> GetConsumer<T>(this ReadOnlySpan<Task<T>> tasks)
{
var pipe = new TaskCompletionPipe<Task<T>>();
pipe.Submit(tasks, complete: true);
pipe.Add(tasks, complete: true);
return new(pipe);
}

/// <summary>
/// Gets a collection over tasks to be available as they complete.
/// Creates a collection over tasks to be available as they complete.
/// </summary>
/// <param name="tasks">A collection of tasks.</param>
/// <typeparam name="T">The type of tasks.</typeparam>
/// <returns>A collection over tasks to be available as they complete.</returns>
public static IAsyncEnumerable<T> GetCompletionStream<T>(this ReadOnlySpan<T> tasks)
public static IAsyncEnumerable<T> Create<T>(ReadOnlySpan<T> tasks)
where T : Task
{
var pipe = new TaskCompletionPipe<T>();
pipe.Submit(tasks, complete: true);
pipe.Add(tasks, complete: true);
return pipe;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void EnqueueCompletion(T task, uint expectedVersion, object? userData)
/// <param name="complete"><see langword="true"/> to submit tasks and complete the pipe; <see langword="false"/> to submit tasks.</param>
/// <param name="userData">Arbitrary object associated with the tasks.</param>
/// <exception cref="InvalidOperationException">The pipe is closed.</exception>
public void Submit(ReadOnlySpan<T> tasks, bool complete = false, object? userData = null)
public void Add(ReadOnlySpan<T> tasks, bool complete = false, object? userData = null)
{
LinkedValueTaskCompletionSource<bool>? suspendedCaller;
lock (SyncRoot)
Expand Down

0 comments on commit e38245b

Please sign in to comment.