org.jetbrains.kotlinx.jupyter.messaging.JupyterConnectionImpl.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-jupyter-kernel Show documentation
Show all versions of kotlin-jupyter-kernel Show documentation
Kotlin Jupyter kernel published as artifact
package org.jetbrains.kotlinx.jupyter.messaging
import org.jetbrains.kotlinx.jupyter.api.KernelLoggerFactory
import org.jetbrains.kotlinx.jupyter.protocol.AbstractJupyterConnection
import org.jetbrains.kotlinx.jupyter.protocol.openServerSocket
import org.jetbrains.kotlinx.jupyter.startup.KernelConfig
import java.io.Closeable
class JupyterConnectionImpl(
private val loggerFactory: KernelLoggerFactory,
private val config: KernelConfig,
) : AbstractJupyterConnection(), JupyterConnectionInternal, Closeable {
override val socketManager: JupyterSocketManager =
JupyterSocketManagerImpl { socketInfo, context ->
openServerSocket(
loggerFactory,
socketInfo,
context,
config,
)
}
override fun close() {
socketManager.close()
}
}