From 0bb7cf3176a9ee74850dd59f0d630d59a717a73b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 2 Jul 2024 09:36:48 +0000 Subject: [PATCH] Generate async files --- ...PostTransactionWorkQueueSynchronization.cs | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/NHibernate.Search/Async/Backend/Impl/PostTransactionWorkQueueSynchronization.cs diff --git a/src/NHibernate.Search/Async/Backend/Impl/PostTransactionWorkQueueSynchronization.cs b/src/NHibernate.Search/Async/Backend/Impl/PostTransactionWorkQueueSynchronization.cs new file mode 100644 index 0000000..c49892b --- /dev/null +++ b/src/NHibernate.Search/Async/Backend/Impl/PostTransactionWorkQueueSynchronization.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by AsyncGenerator. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +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(cancellationToken); + } + try + { + ExecuteBeforeTransactionCompletion(); + return Task.CompletedTask; + } + catch (System.Exception ex) + { + return Task.FromException(ex); + } + } + + public Task ExecuteAfterTransactionCompletionAsync(bool success, CancellationToken cancellationToken) + { + if (cancellationToken.IsCancellationRequested) + { + return Task.FromCanceled(cancellationToken); + } + try + { + ExecuteAfterTransactionCompletion(success); + return Task.CompletedTask; + } + catch (System.Exception ex) + { + return Task.FromException(ex); + } + } + } +} \ No newline at end of file