Skip to content

Commit

Permalink
Mark TcpPrinterManager as ExperimentalEscPosApi
Browse files Browse the repository at this point in the history
  • Loading branch information
okarmazin committed Jan 28, 2024
1 parent 3812f28 commit 5260e21
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package cz.multiplatform.escpos4k.tcp
import arrow.core.Either
import arrow.core.left
import arrow.core.right
import cz.multiplatform.escpos4k.core.ExperimentalEscPosApi
import io.ktor.network.selector.*
import io.ktor.network.sockets.*
import io.ktor.utils.io.*
Expand All @@ -31,6 +32,7 @@ import kotlinx.coroutines.ensureActive
import kotlinx.coroutines.withContext
import kotlinx.coroutines.withTimeout

@ExperimentalEscPosApi
public interface TcpPrinterManager {
/**
* Open a TCP connection to the specified address. You are responsible for closing the connection
Expand All @@ -48,8 +50,10 @@ public interface TcpPrinterManager {
): Either<TcpError, TcpPrinterConnection>
}

@ExperimentalEscPosApi
public fun TcpPrinterManager(): TcpPrinterManager = TcpPrinterManagerImpl()

@OptIn(ExperimentalEscPosApi::class)
private class TcpPrinterManagerImpl : TcpPrinterManager {
override suspend fun openConnection(
name: String,
Expand Down

0 comments on commit 5260e21

Please sign in to comment.