#pragma once

#include <balancer/kernel/io/iobase.h>
#include <balancer/kernel/coro/waked.h>

namespace NHttp::NRequesters {
class TChannelInput : public NSrvKernel::IIoInput {
  public:
    TChannelInput(NSrvKernel::TU2WChannel<NSrvKernel::TChunkList>& channel, TContExecutor* executor);

  private:
    NSrvKernel::TError DoRecv(NSrvKernel::TChunkList& lst, TInstant deadline) noexcept override;

  private:
    NSrvKernel::TU2WChannel<NSrvKernel::TChunkList>& Channel_;
    TContExecutor* Executor_ = nullptr;
    bool Eof_ = false;
};
}
