All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlinx.jupyter.messaging.AbstractMessageHandler.kt Maven / Gradle / Ivy

Go to download

Implementation of REPL compiler and preprocessor for Jupyter dialect of Kotlin (IDE-compatible)

There is a newer version: 0.12.0-333
Show newest version
package org.jetbrains.kotlinx.jupyter.messaging

import org.jetbrains.kotlinx.jupyter.api.libraries.JupyterSocketType
import org.jetbrains.kotlinx.jupyter.api.libraries.RawMessage

abstract class AbstractMessageHandler : MessageHandler {
    abstract fun createProcessor(message: RawMessage): MessageRequestProcessor

    override fun handleMessage(
        socketType: JupyterSocketType,
        message: RawMessage,
    ) {
        val processor = createProcessor(message)
        when (socketType) {
            JupyterSocketType.SHELL -> processor.processShellMessage()
            JupyterSocketType.CONTROL -> processor.processControlMessage()
            JupyterSocketType.STDIN -> processor.processStdinMessage()
            else -> {}
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy