HBRequestBodyStreamer
public final class HBRequestBodyStreamer : HBStreamerProtocol
Request body streamer. HBHTTPDecodeHandler
feeds this with ByteBuffers while the Router consumes them
-
Undocumented
See moreDeclaration
Swift
public enum StreamerError : Swift.Error
-
Values we can feed the streamer with
See moreDeclaration
Swift
public enum FeedInput
-
Values returned when we consume the contents of the streamer
See moreDeclaration
Swift
public enum ConsumeOutput
-
Consume what has been fed to the request
Declaration
Swift
public func consume(on eventLoop: EventLoop) -> EventLoopFuture<ConsumeOutput>
Parameters
eventLoop
EventLoop to return future on
Return Value
Returns an EventLoopFuture that will be fulfilled with array of ByteBuffers that has so far been fed to th request body and whether we have consumed everything
-
Consume the request body, calling
process
on each buffer until you receive an end tagDeclaration
Swift
public func consumeAll(on eventLoop: EventLoop, _ process: @escaping (ByteBuffer) -> EventLoopFuture<Void>) -> EventLoopFuture<Void>
Parameters
eventLoop
EventLoop to run on
process
Closure to call to process ByteBuffer
Return Value
EventLoopFuture that will be fulfilled when all ByteBuffers have been consumed