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

support scala3 on unix-domain connector #162

Merged
merged 1 commit into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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)
}