Skip to content

Commit

Permalink
support scala3 on unix-domain connector (#162)
Browse files Browse the repository at this point in the history
format
  • Loading branch information
pjfanning committed Jun 26, 2023
1 parent 36770bb commit bafc4f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ object Dependencies {
"org.apache.pekko" %% "pekko-http-testkit" % PekkoHttpVersion % Test))

val UnixDomainSocket = Seq(
crossScalaVersions -= Scala3,
libraryDependencies ++= Seq(
"com.github.jnr" % "jffi" % "1.3.1", // classifier "complete", // Is the classifier needed anymore?
"com.github.jnr" % "jnr-unixsocket" % "0.38.5" // BSD/ApacheV2/CPL/MIT as per https://github.com/akka/alpakka/issues/620#issuecomment-348727265
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package impl
import org.apache.pekko
import pekko.actor.{ Cancellable, CoordinatedShutdown, ExtendedActorSystem, Extension }
import pekko.annotation.InternalApi
import pekko.event.{ Logging, LoggingAdapter }
import pekko.event.{ LogSource, Logging, LoggingAdapter }
import pekko.stream._
import pekko.stream.connectors.unixdomainsocket.scaladsl.UnixDomainSocket.{
IncomingConnection,
Expand Down Expand Up @@ -371,9 +371,10 @@ private[unixdomainsocket] abstract class UnixDomainSocketImpl(system: ExtendedAc
private val sel = NativeSelectorProvider.getInstance.openSelector

/** Override to customise reported log source */
protected def logSource: Class[_] = this.getClass
protected def logSource: Class[_] = getClass

private val ioThread = new Thread(() => nioEventLoop(sel, Logging(system, logSource)), "unix-domain-socket-io")
private val ioThread =
new Thread(() => nioEventLoop(sel, Logging(system, logSource.getName)), "unix-domain-socket-io")
ioThread.start()

CoordinatedShutdown(system).addTask(CoordinatedShutdown.PhaseServiceStop, "stopUnixDomainSocket") { () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ final class UnixDomainSocket(system: ExtendedActorSystem) extends UnixDomainSock
* for example using the [[pekko.stream.scaladsl.Framing]] stages.
*/
def outgoingConnection(path: Path): Flow[ByteString, ByteString, Future[OutgoingConnection]] =
super.outgoingConnection(UnixSocketAddress(path))
super.outgoingConnection(UnixSocketAddress(path), None, true, Duration.Inf)
}

0 comments on commit bafc4f3

Please sign in to comment.