@@ -31,7 +31,7 @@ internal class GrpcWorker : IWorker
3131 private readonly IOutputBindingsInfoProvider _outputBindingsInfoProvider ;
3232 private readonly IMethodInfoLocator _methodInfoLocator ;
3333 private readonly IOptions < GrpcWorkerStartupOptions > _startupOptions ;
34- private readonly IOptions < WorkerOptions > _workerOptions ;
34+ private readonly ObjectSerializer _serializer ;
3535
3636 private Task ? _writerTask ;
3737 private Task ? _readerTask ;
@@ -53,7 +53,7 @@ public GrpcWorker(IFunctionsApplication application, FunctionRpcClient rpcClient
5353 _outputBindingsInfoProvider = outputBindingsInfoProvider ?? throw new ArgumentNullException ( nameof ( outputBindingsInfoProvider ) ) ;
5454 _methodInfoLocator = methodInfoLocator ?? throw new ArgumentNullException ( nameof ( methodInfoLocator ) ) ;
5555 _startupOptions = startupOptions ?? throw new ArgumentNullException ( nameof ( startupOptions ) ) ;
56- _workerOptions = workerOptions ?? throw new ArgumentNullException ( nameof ( workerOptions ) ) ;
56+ _serializer = workerOptions . Value . Serializer ?? throw new InvalidOperationException ( nameof ( workerOptions . Value . Serializer ) ) ;
5757 }
5858
5959 public Task StartAsync ( CancellationToken token )
@@ -119,7 +119,7 @@ private async Task ProcessRequestCoreAsync(StreamingMessage request)
119119 if ( request . ContentCase == MsgType . InvocationRequest )
120120 {
121121 responseMessage . InvocationResponse = await InvocationRequestHandlerAsync ( request . InvocationRequest , _application ,
122- _invocationFeaturesFactory , _workerOptions . Value . Serializer , _outputBindingsInfoProvider ) ;
122+ _invocationFeaturesFactory , _serializer , _outputBindingsInfoProvider ) ;
123123 }
124124 else if ( request . ContentCase == MsgType . WorkerInitRequest )
125125 {
0 commit comments