Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Mark SSE encode method as internal stable #4469

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ package scaladsl
package model
package sse

import java.nio.charset.StandardCharsets.UTF_8
import akka.annotation.InternalStableApi

import java.nio.charset.StandardCharsets.UTF_8
import akka.http.javadsl.model
import akka.util.ByteString

Expand Down Expand Up @@ -88,6 +89,7 @@ final case class ServerSentEvent(
require(id.forall(noNewLine), "id must not contain \\n or \\r!")
require(retry.forall(_ > 0), "retry must be a positive number!")

@InternalStableApi
private[scaladsl] def encode = {
def s = { // Performance fun fact: change this to val and get an ~30% performance penalty!!!
// Why 8? "data:" == 5 + \n\n (1 data (at least) and 1 ending) == 2 and then we add 1 extra to allocate
Expand Down
Loading