HBRequestBodyStreamer

public final class HBRequestBodyStreamer : HBStreamerProtocol

Request body streamer. HBHTTPDecodeHandler feeds this with ByteBuffers while the Router consumes them

  • Undocumented

    See more

    Declaration

    Swift

    public enum StreamerError : Swift.Error
  • Values we can feed the streamer with

    See more

    Declaration

    Swift

    public enum FeedInput
  • Values returned when we consume the contents of the streamer

    See more

    Declaration

    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 tag

    Declaration

    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