From bea3bca3d9e738d0c3ec82652d441223bfd5a7dd Mon Sep 17 00:00:00 2001 From: hadashi Date: Wed, 9 Jun 2021 11:47:05 +0900 Subject: [PATCH] Add `[Preserve]` to AsyncRequestHandler --- .../Assets/Plugins/MessagePipe/Runtime/AsyncRequestHandler.cs | 4 ++++ src/MessagePipe/AsyncRequestHandler.cs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/MessagePipe.Unity/Assets/Plugins/MessagePipe/Runtime/AsyncRequestHandler.cs b/src/MessagePipe.Unity/Assets/Plugins/MessagePipe/Runtime/AsyncRequestHandler.cs index 50e9f79..58f4489 100644 --- a/src/MessagePipe.Unity/Assets/Plugins/MessagePipe/Runtime/AsyncRequestHandler.cs +++ b/src/MessagePipe.Unity/Assets/Plugins/MessagePipe/Runtime/AsyncRequestHandler.cs @@ -10,10 +10,12 @@ namespace MessagePipe { // async + [Preserve] public sealed class AsyncRequestHandler : IAsyncRequestHandler { readonly IAsyncRequestHandlerCore handler; + [Preserve] public AsyncRequestHandler(IAsyncRequestHandlerCore handler, FilterAttachedAsyncRequestHandlerFactory handlerFactory) { this.handler = handlerFactory.CreateAsyncRequestHandler(handler); @@ -25,11 +27,13 @@ public UniTask InvokeAsync(TRequest request, CancellationToken cancel } } + [Preserve] public sealed class AsyncRequestAllHandler : IAsyncRequestAllHandler { readonly IAsyncRequestHandlerCore[] handlers; readonly AsyncPublishStrategy defaultAsyncPublishStrategy; + [Preserve] public AsyncRequestAllHandler(IEnumerable> handlers, FilterAttachedAsyncRequestHandlerFactory handlerFactory, MessagePipeOptions options) { var collection = (handlers as ICollection>) ?? handlers.ToArray(); diff --git a/src/MessagePipe/AsyncRequestHandler.cs b/src/MessagePipe/AsyncRequestHandler.cs index d630516..adea467 100644 --- a/src/MessagePipe/AsyncRequestHandler.cs +++ b/src/MessagePipe/AsyncRequestHandler.cs @@ -10,10 +10,12 @@ namespace MessagePipe { // async + [Preserve] public sealed class AsyncRequestHandler : IAsyncRequestHandler { readonly IAsyncRequestHandlerCore handler; + [Preserve] public AsyncRequestHandler(IAsyncRequestHandlerCore handler, FilterAttachedAsyncRequestHandlerFactory handlerFactory) { this.handler = handlerFactory.CreateAsyncRequestHandler(handler); @@ -25,11 +27,13 @@ public ValueTask InvokeAsync(TRequest request, CancellationToken canc } } + [Preserve] public sealed class AsyncRequestAllHandler : IAsyncRequestAllHandler { readonly IAsyncRequestHandlerCore[] handlers; readonly AsyncPublishStrategy defaultAsyncPublishStrategy; + [Preserve] public AsyncRequestAllHandler(IEnumerable> handlers, FilterAttachedAsyncRequestHandlerFactory handlerFactory, MessagePipeOptions options) { var collection = (handlers as ICollection>) ?? handlers.ToArray();