userver: engine::io::PipeReader Class Reference
Loading...
Searching...
No Matches
engine::io::PipeReader Class Referencefinal

#include <userver/engine/io/pipe.hpp>

Detailed Description

Reading end of an unidirectional pipe.

Definition at line 20 of file pipe.hpp.

+ Inheritance diagram for engine::io::PipeReader:
+ Collaboration diagram for engine::io::PipeReader:

Public Member Functions

bool IsValid () const override
 Whether the reading end of the pipe is valid.
 
bool WaitReadable (Deadline) override
 Suspends current task until the pipe has data available.
 
size_t ReadSome (void *buf, size_t len, Deadline deadline) override
 Receives at least one bytes from the pipe.
 
size_t ReadAll (void *buf, size_t len, Deadline deadline) override
 
int Fd () const
 File descriptor corresponding to the read end of the pipe.
 
int Release () noexcept
 Releases reading end file descriptor and invalidates it.
 
void Close ()
 
- Public Member Functions inherited from engine::io::ReadableBase
impl::ContextAccessor * TryGetContextAccessor ()
 For internal use only.
 

Additional Inherited Members

- Protected Member Functions inherited from engine::io::ReadableBase
void SetReadableContextAccessor (impl::ContextAccessor *ca)
 

Member Function Documentation

◆ Close()

void engine::io::PipeReader::Close ( )

Closes and invalidates the reading end of the pipe.

Warning
You should not call Close with pending I/O. This may work okay sometimes but it's loosely predictable.

◆ IsValid()

bool engine::io::PipeReader::IsValid ( ) const
overridevirtual

Whether the reading end of the pipe is valid.

Implements engine::io::ReadableBase.

◆ ReadAll()

size_t engine::io::PipeReader::ReadAll ( void * buf,
size_t len,
Deadline deadline )
overridevirtual

Receives exactly len bytes from the pipe.

Note
Can return less than len if pipe is closed by peer.

Implements engine::io::ReadableBase.

◆ ReadSome()

size_t engine::io::PipeReader::ReadSome ( void * buf,
size_t len,
Deadline deadline )
overridevirtual

Receives at least one bytes from the pipe.

Implements engine::io::ReadableBase.

◆ WaitReadable()

bool engine::io::PipeReader::WaitReadable ( Deadline )
overridevirtual

Suspends current task until the pipe has data available.

Implements engine::io::ReadableBase.

Friends And Related Symbol Documentation

◆ Pipe

friend class Pipe
friend

Definition at line 49 of file pipe.hpp.


The documentation for this class was generated from the following file: