Skip to content

Commit

Permalink
perf: order interceptors only once (#352)
Browse files Browse the repository at this point in the history
config: order interceptors only once
  • Loading branch information
jlabedo authored Jul 26, 2024
1 parent f097959 commit fefc496
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ private function initialize(ModuleRetrievingService $moduleConfigurationRetrievi
private function prepareAndOptimizeConfiguration(InterfaceToCallRegistry $interfaceToCallRegistry, ServiceConfiguration $applicationConfiguration): void
{
$this->verifyEndpointAndChannelNameUniqueness();
$this->beforeSendInterceptors = $this->orderMethodInterceptors($this->beforeSendInterceptors);
$this->beforeCallMethodInterceptors = $this->orderMethodInterceptors($this->beforeCallMethodInterceptors);
$this->afterCallMethodInterceptors = $this->orderMethodInterceptors($this->afterCallMethodInterceptors);

foreach ($this->channelAdapters as $channelAdapter) {
$channelAdapter->withEndpointAnnotations(array_merge($channelAdapter->getEndpointAnnotations(), [new AttributeDefinition(AsynchronousRunningEndpoint::class, [$channelAdapter->getEndpointId()])]));
Expand Down Expand Up @@ -715,7 +718,6 @@ public function registerBeforeSendInterceptor(MethodInterceptor $methodIntercept
}

$this->beforeSendInterceptors[] = $methodInterceptor;
$this->beforeSendInterceptors = $this->orderMethodInterceptors($this->beforeSendInterceptors);

return $this;
}
Expand Down Expand Up @@ -781,7 +783,6 @@ public function registerBeforeMethodInterceptor(MethodInterceptor $methodInterce
}

$this->beforeCallMethodInterceptors[] = $methodInterceptor;
$this->beforeCallMethodInterceptors = $this->orderMethodInterceptors($this->beforeCallMethodInterceptors);

return $this;
}
Expand All @@ -802,7 +803,6 @@ public function registerAfterMethodInterceptor(MethodInterceptor $methodIntercep
}

$this->afterCallMethodInterceptors[] = $methodInterceptor;
$this->afterCallMethodInterceptors = $this->orderMethodInterceptors($this->afterCallMethodInterceptors);

return $this;
}
Expand Down

0 comments on commit fefc496

Please sign in to comment.