Interface TextMessage
- All Superinterfaces:
Message
- All Known Implementing Classes:
TextMessage.Streamed,TextMessage.Strict
Represents a WebSocket text message. A text message can either be a
TextMessage.Strict in which case
the complete data is already available or it can be TextMessage.Streamed in which case textStream
will return a Source streaming the data as it comes in.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic classstatic final classA strictTextMessagethat contains the complete data as aString.static class -
Method Summary
Modifier and TypeMethodDescriptionasScala()org.apache.pekko.stream.javadsl.Source<String,?> Java APIorg.apache.pekko.stream.scaladsl.Source<String,?> The contents of this message as a stream.toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer) scala.concurrent.Future<TextMessage.Strict>toStrict(scala.concurrent.duration.FiniteDuration timeout, org.apache.pekko.stream.Materializer fm) Collects all possible parts and returns a potentially future Strict Message for easier processing.
-
Method Details
-
textStream
org.apache.pekko.stream.scaladsl.Source<String,?> textStream()The contents of this message as a stream.- Returns:
- (undocumented)
-
toStrict
scala.concurrent.Future<TextMessage.Strict> toStrict(scala.concurrent.duration.FiniteDuration timeout, org.apache.pekko.stream.Materializer fm) Collects all possible parts and returns a potentially future Strict Message for easier processing. The Future is failed with an TimeoutException if the stream isn't completed after the given timeout.- Parameters:
timeout- (undocumented)fm- (undocumented)- Returns:
- (undocumented)
-
getStreamedText
org.apache.pekko.stream.javadsl.Source<String,?> getStreamedText()Java API -
asScala
TextMessage asScala() -
toStrict
CompletionStage<TextMessage.Strict> toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer)
-