Skip to content

Commit

Permalink
Generate async files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 2, 2024
1 parent 58d11d2 commit 0bb7cf3
Showing 1 changed file with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by AsyncGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------


using NHibernate.Transaction;
using NHibernate.Util;

namespace NHibernate.Search.Backend.Impl
{
using System.Threading.Tasks;
using System.Threading;
internal partial class PostTransactionWorkQueueSynchronization : ITransactionCompletionSynchronization
{
public Task ExecuteBeforeTransactionCompletionAsync(CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
return Task.FromCanceled<object>(cancellationToken);
}
try
{
ExecuteBeforeTransactionCompletion();
return Task.CompletedTask;
}
catch (System.Exception ex)
{
return Task.FromException<object>(ex);
}
}

public Task ExecuteAfterTransactionCompletionAsync(bool success, CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
return Task.FromCanceled<object>(cancellationToken);
}
try
{
ExecuteAfterTransactionCompletion(success);
return Task.CompletedTask;
}
catch (System.Exception ex)
{
return Task.FromException<object>(ex);
}
}
}
}

0 comments on commit 0bb7cf3

Please sign in to comment.