Skip to content

Commit

Permalink
Don't use Task.Run as we're now "async all the way"
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hathcock committed Aug 3, 2015
1 parent 96c3ab5 commit ef92106
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/Loggly/LogglyClient.cs
Expand Up @@ -11,14 +11,14 @@ namespace Loggly

public class LogglyClient : ILogglyClient
{
public Task<LogResponse> Log(LogglyEvent logglyEvent)
public async Task<LogResponse> Log(LogglyEvent logglyEvent)
{
return Task.Run(async () => await LogWorker(new [] {logglyEvent}).ConfigureAwait(false));
return await LogWorker(new [] {logglyEvent}).ConfigureAwait(false);
}

public Task<LogResponse> Log(IEnumerable<LogglyEvent> logglyEvents)
public async Task<LogResponse> Log(IEnumerable<LogglyEvent> logglyEvents)
{
return Task.Run(async () => await LogWorker(logglyEvents.ToArray()).ConfigureAwait(false));
return await LogWorker(logglyEvents.ToArray()).ConfigureAwait(false);
}

private async Task<LogResponse> LogWorker(LogglyEvent[] events)
Expand Down

0 comments on commit ef92106

Please sign in to comment.