Skip to content

Commit ba0aced

Browse files
authored
use Scala Future Converters (#777)
1 parent 4554b17 commit ba0aced

File tree

25 files changed

+46
-37
lines changed

25 files changed

+46
-37
lines changed

http-caching/src/main/scala/org/apache/pekko/http/caching/LfuCache.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import java.util.function.BiFunction
1919
import scala.concurrent.duration.Duration
2020
import scala.concurrent.{ ExecutionContext, Future }
2121
import scala.jdk.CollectionConverters._
22+
import scala.jdk.FutureConverters._
2223

2324
import com.github.benmanes.caffeine.cache.{ AsyncCache, Caffeine }
2425
import org.apache.pekko
@@ -28,7 +29,6 @@ import pekko.http.caching.LfuCache.toJavaMappingFunction
2829
import pekko.http.caching.scaladsl.Cache
2930
import pekko.http.impl.util.JavaMapping.Implicits._
3031
import pekko.http.caching.CacheJavaMapping.Implicits._
31-
import pekko.util.FutureConverters._
3232
import pekko.util.FunctionConverters._
3333

3434
@ApiMayChange

http-caching/src/main/scala/org/apache/pekko/http/caching/scaladsl/Cache.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import java.util.concurrent.{ CompletableFuture, CompletionStage }
1919
import org.apache.pekko
2020
import pekko.annotation.{ ApiMayChange, DoNotInherit }
2121
import pekko.japi.function.{ Creator, Procedure }
22-
import pekko.util.FutureConverters._
2322

2423
import scala.collection.immutable
2524
import scala.concurrent.{ ExecutionContext, Future, Promise }
2625
import scala.jdk.CollectionConverters._
26+
import scala.jdk.FutureConverters._
2727

2828
/**
2929
* API MAY CHANGE

http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/OutgoingConnectionBuilderImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private[pekko] object OutgoingConnectionBuilderImpl {
158158

159159
private def javaFlow(flow: Flow[HttpRequest, HttpResponse, Future[OutgoingConnection]])
160160
: JFlow[javadsl.model.HttpRequest, javadsl.model.HttpResponse, CompletionStage[javadsl.OutgoingConnection]] = {
161-
import pekko.util.FutureConverters._
161+
import scala.jdk.FutureConverters._
162162
javaFlowKeepMatVal(flow.mapMaterializedValue(f =>
163163
f.map(oc => new javadsl.OutgoingConnection(oc))(ExecutionContext.parasitic).asJava))
164164
}

http-core/src/main/scala/org/apache/pekko/http/impl/util/JavaMapping.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ import pekko.http.javadsl.{
3434
}
3535
import pekko.http.{ javadsl => jdsl, scaladsl => sdsl }
3636
import pekko.http.scaladsl.{ model => sm }
37-
import pekko.util.FutureConverters._
3837

3938
import scala.collection.immutable
4039
import scala.concurrent.{ ExecutionContext, Future }
40+
import scala.jdk.FutureConverters._
4141
import scala.jdk.OptionConverters._
4242
import scala.reflect.ClassTag
4343
import scala.util.Try

http-core/src/main/scala/org/apache/pekko/http/javadsl/ClientTransport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ object ClientTransport {
9797
* to an [[InetSocketAddress]]
9898
*/
9999
def withCustomResolver(lookup: BiFunction[String, Int, CompletionStage[InetSocketAddress]]): ClientTransport = {
100-
import pekko.util.FutureConverters._
100+
import scala.jdk.FutureConverters._
101101
scaladsl.ClientTransport.withCustomResolver((host, port) => lookup.apply(host, port).asScala).asJava
102102
}
103103

http-core/src/main/scala/org/apache/pekko/http/javadsl/Http.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import java.util.Optional
1818
import java.util.concurrent.CompletionStage
1919

2020
import scala.concurrent.Future
21+
import scala.jdk.FutureConverters._
2122
import scala.util.Try
2223

2324
import org.apache.pekko
@@ -37,7 +38,6 @@ import pekko.stream.TLSProtocol._
3738
import pekko.stream.Materializer
3839
import pekko.stream.javadsl.{ BidiFlow, Flow }
3940
import pekko.stream.scaladsl.Keep
40-
import pekko.util.FutureConverters._
4141

4242
object Http extends ExtensionId[Http] with ExtensionIdProvider {
4343
override def get(system: ActorSystem): Http = super.get(system)

http-core/src/main/scala/org/apache/pekko/http/javadsl/IncomingConnection.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@
1313

1414
package org.apache.pekko.http.javadsl
1515

16+
import java.util.concurrent.CompletionStage
1617
import java.net.InetSocketAddress
18+
1719
import org.apache.pekko
1820
import pekko.NotUsed
1921
import pekko.japi.function.Function
2022
import pekko.stream.Materializer
2123
import pekko.stream.javadsl.Flow
2224
import pekko.http.javadsl.model._
2325
import pekko.http.scaladsl.{ model => sm }
24-
import pekko.util.FutureConverters._
25-
import java.util.concurrent.CompletionStage
26+
2627
import scala.concurrent.Future
28+
import scala.jdk.FutureConverters._
2729

2830
/**
2931
* Represents one accepted incoming HTTP connection.

http-core/src/main/scala/org/apache/pekko/http/javadsl/ServerBinding.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import org.apache.pekko
2020
import pekko.Done
2121
import pekko.actor.ClassicActorSystemProvider
2222
import pekko.annotation.DoNotInherit
23-
import pekko.util.FutureConverters._
2423
import pekko.util.JavaDurationConverters._
2524

2625
import scala.concurrent.ExecutionContext
2726
import scala.concurrent.duration.FiniteDuration
27+
import scala.jdk.FutureConverters._
2828

2929
/**
3030
* Represents a prospective HTTP server binding.

http-core/src/main/scala/org/apache/pekko/http/javadsl/ServerBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import pekko.http.scaladsl.{ model => sm }
2727
import pekko.japi.function.Function
2828
import pekko.stream.javadsl.{ Flow, Source }
2929
import pekko.stream.{ Materializer, SystemMaterializer }
30-
import pekko.util.FutureConverters._
3130

3231
import scala.concurrent.ExecutionContext
32+
import scala.jdk.FutureConverters._
3333

3434
/**
3535
* Builder API to create server bindings.

http-core/src/main/scala/org/apache/pekko/http/javadsl/model/ws/Message.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import pekko.http.scaladsl.{ model => sm }
2121
import pekko.stream.Materializer
2222
import pekko.stream.javadsl.Source
2323
import pekko.util.ByteString
24-
import pekko.util.FutureConverters._
2524

2625
import scala.concurrent.duration._
26+
import scala.jdk.FutureConverters._
2727

2828
/**
2929
* Represents a WebSocket message. A message can either be a binary message or a text message.

0 commit comments

Comments
 (0)