Package io.servicetalk.http.api
Interface HttpStreamingSerializer<T>
- Type Parameters:
T
- The type of objects to serialize.
- All Known Subinterfaces:
HttpStreamingSerializerDeserializer<T>
public interface HttpStreamingSerializer<T>
HTTP request/response serialization for streaming payload bodies.
-
Method Summary
Modifier and TypeMethodDescriptionserialize
(HttpHeaders headers, Publisher<T> value, BufferAllocator allocator) default BlockingIterable<Buffer>
serialize
(HttpHeaders headers, BlockingIterable<T> value, BufferAllocator allocator) Serialize anBlockingIterable
of typeHttpStreamingSerializer
into anBlockingIterable
of typeBuffer
.serialize
(HttpHeaders headers, HttpPayloadWriter<Buffer> payloadWriter, BufferAllocator allocator) Returns anHttpPayloadWriter
of typeHttpStreamingSerializer
which serializes eachwritten object
into aBuffer
.
-
Method Details
-
serialize
Serialize aPublisher
of typeHttpStreamingSerializer
into aPublisher
of typeBuffer
. If necessary theHttpHeaders
should be updated to indicate the content-type.- Parameters:
headers
- TheHttpHeaders
associated with the serialization operation.value
- The objects to serialize.allocator
- TheBufferAllocator
used to create the resultingBuffer
s.- Returns:
- The result of the serialization operation.
-
serialize
default BlockingIterable<Buffer> serialize(HttpHeaders headers, BlockingIterable<T> value, BufferAllocator allocator) Serialize anBlockingIterable
of typeHttpStreamingSerializer
into anBlockingIterable
of typeBuffer
. If necessary theHttpHeaders
should be updated to indicate the content-type.- Parameters:
headers
- TheHttpHeaders
associated with the serialization operation.value
- The objects to serialize.allocator
- TheBufferAllocator
used to create the resultingBuffer
s.- Returns:
- The result of the serialization operation.
-
serialize
HttpPayloadWriter<T> serialize(HttpHeaders headers, HttpPayloadWriter<Buffer> payloadWriter, BufferAllocator allocator) Returns anHttpPayloadWriter
of typeHttpStreamingSerializer
which serializes eachwritten object
into aBuffer
. If necessary theHttpHeaders
should be updated to indicate the content-type.- Parameters:
headers
- TheHttpHeaders
associated with the serialization operation.payloadWriter
- TheHttpPayloadWriter
which writes serializedBuffer
s.allocator
- TheBufferAllocator
used to create the resultingBuffer
s.- Returns:
- The
HttpPayloadWriter
of typeHttpStreamingSerializer
with embedded serialization into aBuffer
.
-