Skip to content

Commit

Permalink
Eventdispatcherissue (#35) (#54)
Browse files Browse the repository at this point in the history
Fixed Timing issue with Activate() & Track() being called sequentially
  • Loading branch information
mfahadahmed authored and kellyroach-optimizely committed Jan 22, 2018
1 parent 49b7e5d commit 5df7cfb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions OptimizelySDK/Event/Dispatcher/HttpClientEventDispatcher45.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static HttpClientEventDispatcher45()
/// <summary>
/// Dispatch an Event asynchronously
/// </summary>
private async void DispatchEventAsync(LogEvent logEvent)
private async Task DispatchEventAsync(LogEvent logEvent)
{
try
{
Expand All @@ -68,13 +68,11 @@ private async void DispatchEventAsync(LogEvent logEvent)
}

/// <summary>
/// Dispatch an event Asynchronously by creating a new task and calls the
/// Async version of DispatchEvent
/// This is a "Fire and Forget" option
/// Dispatch an event
/// </summary>
public void DispatchEvent(LogEvent logEvent)
{
Task.Run(() => DispatchEventAsync(logEvent));
Task.Run(() => DispatchEventAsync(logEvent)).Wait();
}
}
}
Expand Down

0 comments on commit 5df7cfb

Please sign in to comment.