Skip to content

Commit

Permalink
Fixes for awaiting in Append.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartdesmet committed Sep 26, 2017
1 parent db9f608 commit cad34bd
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static IAsyncObservable<TSource> Append<TSource>(this IAsyncObservable<TS
if (values == null)
throw new ArgumentNullException(nameof(values));

return Create<TSource>(async observer => await source.SubscribeSafeAsync(AsyncObserver.Append(observer, values)));
return Create<TSource>(observer => source.SubscribeSafeAsync(AsyncObserver.Append(observer, values)));
}

public static IAsyncObservable<TSource> Append<TSource>(this IAsyncObservable<TSource> source, IAsyncScheduler scheduler, params TSource[] values)
Expand Down Expand Up @@ -83,7 +83,7 @@ public static IAsyncObservable<TSource> Append<TSource>(this IAsyncObservable<TS
if (values == null)
throw new ArgumentNullException(nameof(values));

return Create<TSource>(async observer => await source.SubscribeSafeAsync(AsyncObserver.Append(observer, values)));
return Create<TSource>(observer => source.SubscribeSafeAsync(AsyncObserver.Append(observer, values)));
}

public static IAsyncObservable<TSource> Append<TSource>(this IAsyncObservable<TSource> source, IAsyncScheduler scheduler, IEnumerable<TSource> values)
Expand Down Expand Up @@ -124,8 +124,8 @@ public static IAsyncObserver<TSource> Append<TSource>(IAsyncObserver<TSource> ob
observer.OnErrorAsync,
async () =>
{
await observer.OnNextAsync(value);
await observer.OnCompletedAsync();
await observer.OnNextAsync(value).ConfigureAwait(false);
await observer.OnCompletedAsync().ConfigureAwait(false);
}
);
}
Expand All @@ -150,8 +150,8 @@ public static (IAsyncObserver<TSource>, IAsyncDisposable) Append<TSource>(IAsync
{
if (!ct.IsCancellationRequested)
{
await observer.OnNextAsync(value);
await observer.OnCompletedAsync();
await observer.OnNextAsync(value).RendezVous(scheduler, ct);
await observer.OnCompletedAsync().RendezVous(scheduler, ct);
}
}).ConfigureAwait(false);

Expand All @@ -176,10 +176,10 @@ public static IAsyncObserver<TSource> Append<TSource>(IAsyncObserver<TSource> ob
{
foreach (var value in values)
{
await observer.OnNextAsync(value);
await observer.OnNextAsync(value).ConfigureAwait(false);
}

await observer.OnCompletedAsync();
await observer.OnCompletedAsync().ConfigureAwait(false);
}
);
}
Expand Down Expand Up @@ -210,10 +210,10 @@ public static IAsyncObserver<TSource> Append<TSource>(IAsyncObserver<TSource> ob
{
foreach (var value in values)
{
await observer.OnNextAsync(value);
await observer.OnNextAsync(value).ConfigureAwait(false);
}

await observer.OnCompletedAsync();
await observer.OnCompletedAsync().ConfigureAwait(false);
}
);
}
Expand Down

0 comments on commit cad34bd

Please sign in to comment.