Skip to content

Commit

Permalink
Update ox
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Sep 25, 2024
1 parent 999ca37 commit d9897da
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ core/native/local.sbt

.metals/
.bloop/
project/metals.sbt
.bsp/
.java-version
metals.sbt

.vscode

# scala-native
lowered.hnir

work.txt
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ val zio2Version = "2.1.9"
val zio1InteropRsVersion = "1.3.12"
val zio2InteropRsVersion = "2.0.2"

val oxVersion = "0.2.0"
val oxVersion = "0.4.0"
val sttpModelVersion = "1.7.11"
val sttpSharedVersion = "1.3.22"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import sttp.model.sse.ServerSentEvent
import java.io.InputStream

object OxServerSentEvents:
def parse(is: InputStream)(using Ox, IO): Source[ServerSentEvent] =
def parse(is: InputStream)(using Ox): Source[ServerSentEvent] =
Source
.fromInputStream(is)
.linesUtf8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import org.scalatest.BeforeAndAfterAll
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import ox.*
import ox.IO.globalForTesting.given
import sttp.client4.*
import sttp.client4.testing.HttpTest.*
import sttp.model.sse.ServerSentEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ class OxWebSocketTest extends AnyFlatSpec with BeforeAndAfterAll with Matchers w
}

def sendText(wsSink: Sink[WebSocketFrame], count: Int)(using Ox): Unit =
Source.fromIterable(1 to count).map(i => WebSocketFrame.text(s"test$i")).pipeTo(wsSink)
Source.fromIterable(1 to count).map(i => WebSocketFrame.text(s"test$i")).pipeTo(wsSink, propagateDone = true)

def sendBinary(wsSink: Sink[WebSocketFrame], count: Int)(using Ox): Unit =
Source.fromIterable(1 to count).map(i => WebSocketFrame.binary(Array(i.toByte))).pipeTo(wsSink)
Source
.fromIterable(1 to count)
.map(i => WebSocketFrame.binary(Array(i.toByte)))
.pipeTo(wsSink, propagateDone = true)

def receiveEchoText(wsSource: Source[WebSocketFrame], count: Int): Unit =
for (i <- 1 to count)
Expand Down

0 comments on commit d9897da

Please sign in to comment.