chen_s
October 20, 2023, 10:20am
1
Hi all,
I am working on some project, in which we are using ota-community-edition as base. In their implementation there are a lot place using following expression e.g.
(LogDirectives.logResponseMetrics(“device-registry”) & requestMetrics(metricRegistry) & versionHeaders(version)) {
prometheusMetricsRoutes ~
tracing.traceRequests { implicit serverRequestTracing =>
new DeviceRegistryRoutes(authNamespace, namespaceAuthorizer, messageBus).route
}
} ~ DbHealthResource(versionMap, healthMetrics = Seq(new BusListenerMetrics(metricRegistry))).route
I find nowhere the meaning of ~ in such expression. And in the file the “prometheusMetricsRoutes” is not defined. I am a newbie of scala, can someone explain me this expression a bit? below is the link to the file
/*
* Copyright (C) 2017 HERE Global B.V.
*
* Licensed under the Mozilla Public License, version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.mozilla.org/en-US/MPL/2.0/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: MPL-2.0
* License-Filename: LICENSE
*/
package com.advancedtelematic.ota.deviceregistry
This file has been truncated. show original
Thanks a lot
It’s from Akka; take a look at the Combinators section: The PathMatcher DSL • Akka HTTP
1 Like