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

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

Detailed Description

Writing end of an unidirectional pipe.

Definition at line 59 of file pipe.hpp.

+ Inheritance diagram for engine::io::PipeWriter:

Public Member Functions

bool IsValid () const
 Whether the writing end of the pipe is valid.
 
bool WaitWriteable (Deadline) override
 
size_t WriteAll (const void *buf, size_t len, Deadline deadline) override
 
int Fd () const
 File descriptor corresponding to the write end of the pipe.
 
int Release () noexcept
 Releases writing end file descriptor and invalidates it.
 
void Close ()
 
virtual size_t WriteAll (std::initializer_list< IoData > list, Deadline deadline)
 
impl::ContextAccessor * TryGetContextAccessor ()
 For internal use only.
 

Protected Member Functions

void SetWritableContextAccessor (impl::ContextAccessor *ca)
 

Member Function Documentation

◆ Close()

void engine::io::PipeWriter::Close ( )

Closes and invalidates the writing end of the pipe.

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

◆ SetWritableContextAccessor()

void engine::io::WritableBase::SetWritableContextAccessor ( impl::ContextAccessor *  ca)
inlineprotectedinherited

Definition at line 96 of file common.hpp.

◆ TryGetContextAccessor()

impl::ContextAccessor * engine::io::WritableBase::TryGetContextAccessor ( )
inlineinherited

For internal use only.

Definition at line 93 of file common.hpp.

◆ WaitWriteable()

bool engine::io::PipeWriter::WaitWriteable ( Deadline  )
overridevirtual

Suspends current task until the pipe can accept more data.

Returns
false on timeout or on task cancellations; true otherwise.

Implements engine::io::WritableBase.

◆ WriteAll() [1/2]

size_t engine::io::PipeWriter::WriteAll ( const void *  buf,
size_t  len,
Deadline  deadline 
)
overridevirtual

Sends exactly len bytes to the pipe.

Note
Can return less than len if pipe is closed by peer.
Returns
count of bytes written to the pipe

Implements engine::io::WritableBase.

◆ WriteAll() [2/2]

virtual size_t engine::io::WritableBase::WriteAll ( std::initializer_list< IoData list,
Deadline  deadline 
)
inlinevirtualinherited

Definition at line 84 of file common.hpp.

Friends And Related Symbol Documentation

◆ Pipe

friend class Pipe
friend

Definition at line 85 of file pipe.hpp.


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