#include <userver/engine/io/pipe.hpp>
Reading end of an unidirectional pipe.
Definition at line 20 of file pipe.hpp.
|
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 () |
|
virtual std::optional< size_t > | ReadNoblock (void *buf, size_t len) |
|
impl::ContextAccessor * | TryGetContextAccessor () |
| For internal use only.
|
|
◆ 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 |
◆ 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.
◆ ReadNoblock()
virtual std::optional< size_t > engine::io::ReadableBase::ReadNoblock |
( |
void * | buf, |
|
|
size_t | len ) |
|
inlinevirtualinherited |
Receives up to len (including zero) bytes from the stream.
- Returns
- filled-in optional on data presence (e.g. 0, 1, 2... bytes) empty optional otherwise
Reimplemented in engine::io::Socket.
Definition at line 39 of file common.hpp.
◆ ReadSome()
size_t engine::io::PipeReader::ReadSome |
( |
void * | buf, |
|
|
size_t | len, |
|
|
Deadline | deadline ) |
|
overridevirtual |
◆ SetReadableContextAccessor()
void engine::io::ReadableBase::SetReadableContextAccessor |
( |
impl::ContextAccessor * | ca | ) |
|
|
inlineprotectedinherited |
◆ TryGetContextAccessor()
impl::ContextAccessor * engine::io::ReadableBase::TryGetContextAccessor |
( |
| ) |
|
|
inlineinherited |
For internal use only.
Definition at line 54 of file common.hpp.
◆ WaitReadable()
bool engine::io::PipeReader::WaitReadable |
( |
Deadline | | ) |
|
|
overridevirtual |
◆ Pipe
The documentation for this class was generated from the following file: