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 58 of file pipe.hpp.

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

Public Member Functions

bool IsValid () const
 Whether the writing end of the pipe is valid.
 
bool WaitWriteable (Deadline) override
 Suspends current task until the pipe can accept more data.
 
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 ()
 
- Public Member Functions inherited from engine::io::WritableBase
virtual size_t WriteAll (std::initializer_list< IoData > list, Deadline deadline)
 
impl::ContextAccessor * TryGetContextAccessor ()
 For internal use only.
 

Additional Inherited Members

- Protected Member Functions inherited from engine::io::WritableBase
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.

◆ WaitWriteable()

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

Suspends current task until the pipe can accept more data.

Implements engine::io::WritableBase.

◆ WriteAll()

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.

Implements engine::io::WritableBase.

Friends And Related Symbol Documentation

◆ Pipe

friend class Pipe
friend

Definition at line 83 of file pipe.hpp.


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