-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce class for setting up debug integration
- Loading branch information
1 parent
064f001
commit ded9168
Showing
9 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
...b/shared-compiler/src/main/kotlin/org/jetbrains/kotlinx/jupyter/debug/DebugIntegration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.jetbrains.kotlinx.jupyter.debug | ||
|
||
import kotlin.concurrent.thread | ||
|
||
abstract class DebugIntegrationProvider( | ||
protected val debugPort: Int?, | ||
) { | ||
companion object { | ||
const val DEBUG_THREAD_NAME = "NotebookDebugThread" | ||
} | ||
|
||
fun provideDebugPort(): Int? = debugPort | ||
|
||
fun provideSuspendedThread(runnable: () -> Unit): Thread { | ||
return thread(start = provideDebugPort() != null, name = DEBUG_THREAD_NAME, block = runnable) | ||
} | ||
} | ||
|
||
class NotebookDebugIntegrationProvider( | ||
debugPort: Int?, | ||
) : DebugIntegrationProvider(debugPort) |
3 changes: 3 additions & 0 deletions
3
...piler/src/main/kotlin/org/jetbrains/kotlinx/jupyter/debug/DebugIntegrationProviderMock.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package org.jetbrains.kotlinx.jupyter.debug | ||
|
||
object DebugIntegrationProviderMock : DebugIntegrationProvider(null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters