@@ -22,14 +22,14 @@ public InProcessFunctionEndpoint(
2222 IServiceProvider serviceProvider )
2323 {
2424 this . serverlessInterceptor = serverlessInterceptor ;
25- endpointFactory = _ => externallyManagedContainerEndpoint . Start ( serviceProvider ) ;
25+ endpointFactory = ( ) => externallyManagedContainerEndpoint . Start ( serviceProvider ) ;
2626 }
2727
2828 public async Task Send ( object message , SendOptions options , ExecutionContext executionContext , ILogger functionsLogger = null , CancellationToken cancellationToken = default )
2929 {
3030 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
3131
32- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
32+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
3333 await endpoint . Send ( message , options , cancellationToken ) . ConfigureAwait ( false ) ;
3434 }
3535
@@ -42,7 +42,7 @@ public async Task Send<T>(Action<T> messageConstructor, SendOptions options, Exe
4242 {
4343 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
4444
45- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
45+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
4646 await endpoint . Send ( messageConstructor , options , cancellationToken ) . ConfigureAwait ( false ) ;
4747 }
4848
@@ -55,7 +55,7 @@ public async Task Publish(object message, PublishOptions options, ExecutionConte
5555 {
5656 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
5757
58- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
58+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
5959 await endpoint . Publish ( message , options , cancellationToken ) . ConfigureAwait ( false ) ;
6060 }
6161
@@ -68,7 +68,7 @@ public async Task Publish<T>(Action<T> messageConstructor, PublishOptions option
6868 {
6969 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
7070
71- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
71+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
7272 await endpoint . Publish ( messageConstructor , options , cancellationToken ) . ConfigureAwait ( false ) ;
7373 }
7474
@@ -81,7 +81,7 @@ public async Task Subscribe(Type eventType, SubscribeOptions options, ExecutionC
8181 {
8282 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
8383
84- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
84+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
8585 await endpoint . Subscribe ( eventType , options , cancellationToken ) . ConfigureAwait ( false ) ;
8686 }
8787
@@ -94,7 +94,7 @@ public async Task Unsubscribe(Type eventType, UnsubscribeOptions options, Execut
9494 {
9595 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
9696
97- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
97+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
9898 await endpoint . Unsubscribe ( eventType , options , cancellationToken ) . ConfigureAwait ( false ) ;
9999 }
100100
@@ -111,7 +111,7 @@ public async Task ProcessNonAtomic(
111111 {
112112 FunctionsLoggerFactory . Instance . SetCurrentLogger ( functionsLogger ) ;
113113
114- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken )
114+ await InitializeEndpointIfNecessary ( cancellationToken )
115115 . ConfigureAwait ( false ) ;
116116
117117 try
@@ -147,7 +147,7 @@ public async Task ProcessAtomic(
147147
148148 try
149149 {
150- await InitializeEndpointIfNecessary ( executionContext , functionsLogger , cancellationToken ) . ConfigureAwait ( false ) ;
150+ await InitializeEndpointIfNecessary ( cancellationToken ) . ConfigureAwait ( false ) ;
151151 }
152152 catch ( Exception )
153153 {
@@ -251,7 +251,7 @@ static AzureServiceBusTransportTransaction CreateTransaction(string messageParti
251251 "Azure.Security.KeyVault.Secrets.dll"
252252 } ;
253253
254- internal async Task InitializeEndpointIfNecessary ( ExecutionContext executionContext , ILogger logger , CancellationToken cancellationToken )
254+ internal async Task InitializeEndpointIfNecessary ( CancellationToken cancellationToken )
255255 {
256256 if ( pipeline == null )
257257 {
@@ -260,8 +260,7 @@ internal async Task InitializeEndpointIfNecessary(ExecutionContext executionCont
260260 {
261261 if ( pipeline == null )
262262 {
263- var functionExecutionContext = new FunctionExecutionContext ( executionContext , logger ) ;
264- endpoint = await endpointFactory ( functionExecutionContext ) . ConfigureAwait ( false ) ;
263+ endpoint = await endpointFactory ( ) . ConfigureAwait ( false ) ;
265264
266265 pipeline = serverlessInterceptor . PipelineInvoker ;
267266 }
@@ -276,7 +275,7 @@ internal async Task InitializeEndpointIfNecessary(ExecutionContext executionCont
276275 PipelineInvoker pipeline ;
277276 IEndpointInstance endpoint ;
278277
279- readonly Func < FunctionExecutionContext , Task < IEndpointInstance > > endpointFactory ;
278+ readonly Func < Task < IEndpointInstance > > endpointFactory ;
280279 readonly SemaphoreSlim semaphoreLock = new SemaphoreSlim ( initialCount : 1 , maxCount : 1 ) ;
281280 readonly ServerlessInterceptor serverlessInterceptor ;
282281 }
0 commit comments