This is an automated email from the ASF dual-hosted git repository.
engelen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-http.git
The following commit(s) were added to refs/heads/main by this push:
new 94aa8befd Update EventStreamUnmarshalling.scala (#802)
94aa8befd is described below
commit 94aa8befd42ae51bee7642ff1baa7d7199831b34
Author: PJ Fanning <[email protected]>
AuthorDate: Sat Sep 27 18:27:39 2025 +0100
Update EventStreamUnmarshalling.scala (#802)
---
.../sse/EventStreamUnmarshalling.scala | 24 ----------------------
1 file changed, 24 deletions(-)
diff --git
a/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
b/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
index c005d0128..819fd6536 100644
---
a/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
+++
b/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
@@ -70,18 +70,6 @@ trait EventStreamUnmarshalling {
settings.oversizedLineStrategy,
settings.oversizedEventStrategy)
- private final def fromEventsStream(maxLineSize: Int, maxEventSize: Int,
emitEmptyEvents: Boolean)
- : FromEntityUnmarshaller[Source[ServerSentEvent, NotUsed]] =
- fromEventsStream(maxLineSize, maxEventSize, emitEmptyEvents, "fail-stream")
-
- private final def fromEventsStream(maxLineSize: Int, maxEventSize: Int,
emitEmptyEvents: Boolean,
- oversizedStrategy: String):
FromEntityUnmarshaller[Source[ServerSentEvent, NotUsed]] =
- fromEventsStreamInternal(maxLineSize, maxEventSize, emitEmptyEvents,
oversizedStrategy)
-
- private final def fromEventsStream(maxLineSize: Int, maxEventSize: Int,
emitEmptyEvents: Boolean,
- oversizedStrategy: OversizedSseStrategy):
FromEntityUnmarshaller[Source[ServerSentEvent, NotUsed]] =
- fromEventsStream(maxLineSize, maxEventSize, emitEmptyEvents,
oversizedStrategy, oversizedStrategy)
-
private final def fromEventsStream(maxLineSize: Int, maxEventSize: Int,
emitEmptyEvents: Boolean,
oversizedLineStrategy: OversizedSseStrategy, oversizedEventStrategy:
OversizedSseStrategy)
: FromEntityUnmarshaller[Source[ServerSentEvent, NotUsed]] = {
@@ -95,16 +83,4 @@ trait EventStreamUnmarshalling {
Unmarshaller.strict(unmarshal).forContentTypes(`text/event-stream`)
}
-
- private final def fromEventsStreamInternal(maxLineSize: Int, maxEventSize:
Int, emitEmptyEvents: Boolean,
- oversizedStrategy: String):
FromEntityUnmarshaller[Source[ServerSentEvent, NotUsed]] = {
- val eventStreamParser = EventStreamParser(maxLineSize, maxEventSize,
emitEmptyEvents, oversizedStrategy)
- def unmarshal(entity: HttpEntity) =
- entity
- .withoutSizeLimit // Because of streaming: the server keeps the
response open and potentially streams huge amounts of data
- .dataBytes
- .viaMat(eventStreamParser)(Keep.none)
-
- Unmarshaller.strict(unmarshal).forContentTypes(`text/event-stream`)
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]