Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::AsyncRequestWritableStream< AsyncRequestType > Struct Template Reference
Inheritance diagram for SC::AsyncRequestWritableStream< AsyncRequestType >:
SC::AsyncWritableStream

Public Member Functions

template<typename DescriptorType >
Result init (AsyncBuffersPool &buffersPool, Span< Request > requests, AsyncEventLoop &eventLoop, const DescriptorType &descriptor)
 
void setAutoCloseDescriptor (bool value)
 Automatically closes descriptor during write stream finish event.
 
- Public Member Functions inherited from SC::AsyncWritableStream
Result init (AsyncBuffersPool &buffersPool, Span< Request > requests)
 Emitted when no more data can be written.
 
Result write (AsyncBufferView::ID bufferID, Function< void(AsyncBufferView::ID)> cb={})
 Writes a buffer (that must be allocated by the AsyncBuffersPool passed in AsyncWritableStream) When the buffer it will be actually written, AsyncWritableStream::eventWritten will be raised and its reference count will be decreased.
 
Result write (AsyncBufferView &&bufferView, Function< void(AsyncBufferView::ID)> cb={})
 Push a new buffer view to the queue, registering it with the allocator.
 
void end ()
 Ends the writable stream, waiting for all in-flight and queued writes to finish.
 
AsyncBuffersPoolgetBuffersPool ()
 Obtains the buffers pool to access its data.
 
void finishedWriting (AsyncBufferView::ID bufferID, Function< void(AsyncBufferView::ID)> &&cb, Result res)
 Signals that the given buffer (previously queued by write) has been fully written.
 
void resumeWriting ()
 Resumes writing queued requests for this stream.
 
Result unshift (AsyncBufferView::ID bufferID, Function< void(AsyncBufferView::ID)> &&cb)
 Puts back a buffer at the top of the write queue.
 
void emitError (Result error)
 Signals an async error received.
 
void tryAsync (Result potentialError)
 Will emit error if the passed in Result is false.
 
void stop ()
 

Public Attributes

AsyncRequestType request
 
- Public Attributes inherited from SC::AsyncWritableStream
Function< Result(AsyncBufferView::ID, Function< void(AsyncBufferView::ID)>)> asyncWrite
 Function that every stream must define to implement its custom write operation.
 
Event< MaxListeners, ResulteventError
 
Event< MaxListeners > eventDrain
 Emitted when an error occurs.
 
Event< MaxListeners > eventFinish
 Emitted when write queue is empty.
 
Function< bool()> canEndWritable
 Allows keeping a writable in ENDING state until it has finished flushing all pending data.
 

Protected Member Functions

Result write (AsyncBufferView::ID bufferID, Function< void(AsyncBufferView::ID)> cb)
 
void onFinishStopRequest ()
 

Protected Attributes

AsyncEventLoopeventLoop = nullptr
 
bool autoCloseDescriptor = false
 
bool justUnrefBuffer = false
 
Function< void(AsyncBufferView::ID)> callback
 

Additional Inherited Members

- Static Public Attributes inherited from SC::AsyncWritableStream
static constexpr int MaxListeners = 8
 

Member Function Documentation

◆ setAutoCloseDescriptor()

template<typename AsyncRequestType >
void SC::AsyncRequestWritableStream< AsyncRequestType >::setAutoCloseDescriptor ( bool value)
inline

Automatically closes descriptor during write stream finish event.


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