Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

concurrent: Tag DirectExecutionContext. #7517

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
concurrent: Tag DirectExecutionContext.
1.  Tag `DirectExecutionContext` as `ExecutionContext[Nothing]`, thereby
    stating that it works for any tagged `Future`.
2.  Move `DirectExecutionContext` to the _libs-scala/concurrent_
    library, as it requires it and it's tiny.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
SamirTalwar committed Sep 29, 2020
commit 1849b766ec1190d713bd847affa9cf273e7c58d0
2 changes: 1 addition & 1 deletion ledger-api/rs-grpc-akka/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ da_scala_library(
],
deps = [
"//ledger-api/rs-grpc-bridge",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:io_grpc_grpc_stub",
Expand Down
2 changes: 1 addition & 1 deletion ledger-api/testing-utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ da_scala_library(
"//ledger-api/grpc-definitions:ledger-api-scalapb",
"//ledger-api/rs-grpc-akka",
"//ledger-api/rs-grpc-bridge",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/grpc-utils",
"//libs-scala/resources",
"@maven//:com_google_guava_guava",
Expand Down
2 changes: 1 addition & 1 deletion ledger/ledger-api-auth/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ da_scala_library(
"//ledger-api/grpc-definitions:ledger-api-scalapb",
"//ledger-service/jwt",
"//ledger/ledger-api-common",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:com_auth0_java_jwt",
"@maven//:io_grpc_grpc_api",
"@maven//:io_grpc_grpc_context",
Expand Down
6 changes: 3 additions & 3 deletions ledger/ledger-api-client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ da_scala_library(
"//ledger-api/rs-grpc-bridge",
"//ledger/ledger-api-auth-client",
"//ledger/ledger-api-domain",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/resources",
Expand All @@ -46,7 +46,7 @@ da_scala_test_suite(
"//ledger-api/rs-grpc-bridge",
"//ledger-api/testing-utils",
"//ledger/caching",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:com_github_ghik_silencer_lib_2_12_11",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
Expand Down Expand Up @@ -83,7 +83,7 @@ da_scala_test_suite(
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/resources",
Expand Down
6 changes: 3 additions & 3 deletions ledger/ledger-api-common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ da_scala_library(
"//ledger/ledger-api-domain",
"//ledger/ledger-api-health",
"//ledger/metrics",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/resources",
"@maven//:com_github_ghik_silencer_lib_2_12_11",
"@maven//:com_typesafe_akka_akka_actor_2_12",
Expand All @@ -56,7 +56,7 @@ da_scala_library(
"//daml-lf/transaction",
"//language-support/scala/bindings",
"//ledger/ledger-api-domain",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:io_zipkin_brave_brave",
"@maven//:org_scalactic_scalactic_2_12",
Expand All @@ -83,7 +83,7 @@ da_scala_test_suite(
"//ledger/ledger-api-client",
"//ledger/ledger-api-domain",
"//ledger/ledger-api-health",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/grpc-utils",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
Expand Down
2 changes: 1 addition & 1 deletion ledger/ledger-on-memory/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ da_scala_library(
"//ledger/metrics",
"//ledger/participant-state",
"//ledger/participant-state/kvutils",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/resources",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_typesafe_akka_akka_actor_2_12",
Expand Down
2 changes: 1 addition & 1 deletion ledger/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ da_scala_library(
],
runtime_deps = [],
deps = [
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
"@maven//:io_dropwizard_metrics_metrics_core",
Expand Down
4 changes: 2 additions & 2 deletions ledger/participant-integration-api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ compile_deps = [
"//ledger/participant-state-index",
"//libs-scala/build-info",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/ports",
"//libs-scala/resources",
"//libs-scala/scala-utils",
Expand Down Expand Up @@ -180,7 +180,7 @@ test_deps = [
"//ledger/participant-state-index",
"//ledger/test-common",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
Expand Down
2 changes: 1 addition & 1 deletion ledger/participant-state/kvutils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ da_scala_library(
"//ledger/metrics",
"//ledger/participant-state",
"//ledger/participant-state/protobuf:ledger_configuration_java_proto",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/resources",
"//libs-scala/timer-utils",
"@maven//:com_github_ghik_silencer_lib_2_12_11",
Expand Down
2 changes: 1 addition & 1 deletion ledger/participant-state/kvutils/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ da_scala_binary(
"//ledger/participant-state",
"//ledger/participant-state/kvutils",
"//ledger/participant-state/kvutils:daml_kvutils_java_proto",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_typesafe_akka_akka_actor_2_12",
"@maven//:com_typesafe_akka_akka_stream_2_12",
Expand Down
6 changes: 3 additions & 3 deletions ledger/sandbox-classic/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ da_scala_library(
"//ledger/participant-state-metrics",
"//ledger/sandbox-common",
"//libs-scala/build-info",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/ports",
"//libs-scala/resources",
"//libs-scala/resources-akka",
Expand Down Expand Up @@ -154,8 +154,8 @@ da_scala_library(
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
Expand Down Expand Up @@ -209,7 +209,7 @@ test_deps = [
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
Expand Down
2 changes: 1 addition & 1 deletion ledger/sandbox-common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ da_scala_library(
"//ledger/participant-integration-api",
"//ledger/participant-state",
"//libs-scala/build-info",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/ports",
"//libs-scala/resources",
"@maven//:ch_qos_logback_logback_classic",
Expand Down
4 changes: 2 additions & 2 deletions ledger/sandbox-perf/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ da_scala_library(
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
"//libs-scala/resources",
Expand Down Expand Up @@ -92,7 +92,7 @@ da_scala_benchmark_jmh(
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_typesafe_akka_akka_actor_2_12",
Expand Down
2 changes: 1 addition & 1 deletion ledger/sandbox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ da_scala_test_suite(
"//ledger/sandbox-common",
"//ledger/sandbox-common:sandbox-common-scala-tests-lib",
"//ledger/test-common",
"//libs-scala/concurrent",
"//libs-scala/contextualized-logging",
"//libs-scala/direct-execution-context",
"//libs-scala/grpc-utils",
"//libs-scala/ports",
"//libs-scala/postgresql-testing",
Expand Down
2 changes: 1 addition & 1 deletion ledger/test-common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ da_scala_library(
],
deps = [
"//ledger-api/grpc-definitions:ledger-api-scalapb",
"//libs-scala/direct-execution-context",
"//libs-scala/concurrent",
"//libs-scala/timer-utils",
"@maven//:ch_qos_logback_logback_classic",
"@maven//:ch_qos_logback_logback_core",
Expand Down
1 change: 1 addition & 0 deletions libs-scala/concurrent/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ da_scala_library(
],
deps = [
"@maven//:org_scalaz_scalaz_core_2_12",
"@maven//:org_slf4j_slf4j_api",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.slf4j.LoggerFactory
import scala.concurrent.ExecutionContext

// Starting from Scala 2.13 this can deleted and replaced by `parasitic`
object DirectExecutionContext extends ExecutionContext {
object DirectExecutionContextInternal extends ExecutionContext {
This conversation was marked as resolved.
Show resolved Hide resolved

private[this] val logger = LoggerFactory.getLogger(this.getClass)

Expand Down
14 changes: 14 additions & 0 deletions libs-scala/concurrent/src/main/scala/dec/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.daml

import com.daml.concurrent.ExecutionContext

package object dec {

// Starting from Scala 2.13 this can deleted and replaced by `parasitic`
val DirectExecutionContext: ExecutionContext[Nothing] =
ExecutionContext(DirectExecutionContextInternal)

}
19 changes: 0 additions & 19 deletions libs-scala/direct-execution-context/BUILD.bazel

This file was deleted.

2 changes: 0 additions & 2 deletions release/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@
type: jar-scala
- target: //libs-scala/contextualized-logging:contextualized-logging
type: jar-scala
- target: //libs-scala/direct-execution-context:direct-execution-context
type: jar-scala
- target: //libs-scala/grpc-utils:grpc-utils
type: jar-scala
- target: //libs-scala/ports:ports
Expand Down