public Task ClearAllPoolsAsync() { return(Task.Factory.StartNew(delegate { MySqlConnection.ClearAllPools(); })); }
public Task ClearAllPoolsAsync(CancellationToken cancellationToken) { TaskCompletionSource <bool> taskCompletionSource = new TaskCompletionSource <bool>(); if (cancellationToken == CancellationToken.None || !cancellationToken.IsCancellationRequested) { try { MySqlConnection.ClearAllPools(); taskCompletionSource.SetResult(true); goto IL_3B; } catch (Exception exception) { taskCompletionSource.SetException(exception); goto IL_3B; } } taskCompletionSource.SetCanceled(); IL_3B: return(taskCompletionSource.Task); }
public static void ClearConnectionPools() => MySqlConnection.ClearAllPools();