-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathJavaConversions.scala
38 lines (32 loc) · 1.22 KB
/
JavaConversions.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/
package scala.concurrent
import java.util.concurrent.{ExecutorService, Executor}
import scala.language.implicitConversions
/** The `JavaConversions` object provides implicit conversions supporting
* interoperability between Scala and Java concurrency classes.
*/
@deprecated("Use the factory methods in `ExecutionContext` instead", "2.13.0")
object JavaConversions {
/**
* Creates a new `ExecutionContext` which uses the provided `ExecutorService`.
*/
@deprecated("Use `ExecutionContext.fromExecutorService` instead", "2.13.0")
implicit def asExecutionContext(exec: ExecutorService): ExecutionContextExecutorService =
ExecutionContext.fromExecutorService(exec)
/**
* Creates a new `ExecutionContext` which uses the provided `Executor`.
*/
@deprecated("Use `ExecutionContext.fromExecutor` instead", "2.13.0")
implicit def asExecutionContext(exec: Executor): ExecutionContextExecutor =
ExecutionContext.fromExecutor(exec)
}