HBResponseBody
public enum HBResponseBody
Response body. Either static
-
Body stored as a single ByteBuffer
Declaration
Swift
case byteBuffer(ByteBuffer)
-
Streamer object supplying byte buffers
Declaration
Swift
case stream(HBResponseBodyStreamer)
-
Empty body
Declaration
Swift
case empty
-
Construct a
HBResponseBody
from a closure supplyingByteBuffer
‘s.This function should supply
.byteBuffer(ByteBuffer)
until there is no more data, at which point is should return'end
.Declaration
Swift
public static func streamCallback(_ closure: @escaping (EventLoop) -> EventLoopFuture<HBResponseBody.StreamResult>) -> HBResponseBody
Parameters
closure
Closure called whenever a new ByteBuffer is needed
-
response body streamer result. Either a ByteBuffer or the end of the stream
See moreDeclaration
Swift
public enum StreamResult