Wt  4.10.4
Public Member Functions | List of all members
Wt::Http::ResponseContinuation Class Reference

A resource response continuation object. More...

#include <Wt/Http/ResponseContinuation.h>

Inherits std::enable_shared_from_this< ResponseContinuation >.

Public Member Functions

void setData (const cpp17::any &data)
 Set data associated with the continuation. More...
 
cpp17::any data ()
 Return data associated with the continuation. More...
 
WResourceresource () const
 Return the resource.
 
void waitForMoreData ()
 Wait for more data. More...
 
void haveMoreData ()
 Indicates that we have more data. More...
 
bool isWaitingForMoreData () const
 Returns whether this continuation is waiting for data. More...
 

Detailed Description

A resource response continuation object.

A response continuation object is used to keep track of a response which is to be continued.

You may associate data with the object using setData().

A continuation is used to resume sending more data later for this response. There are two possible reasons for this:

See also
Response::createContinuation(), Request::continuation()

Member Function Documentation

◆ data()

cpp17::any Wt::Http::ResponseContinuation::data ( )

Return data associated with the continuation.

See also
setData()

◆ haveMoreData()

void Wt::Http::ResponseContinuation::haveMoreData ( )

Indicates that we have more data.

This will allow the response to be resumed with a new call to WResource::handleRequest().

◆ isWaitingForMoreData()

bool Wt::Http::ResponseContinuation::isWaitingForMoreData ( ) const

Returns whether this continuation is waiting for data.

See also
waitForMoreData()

◆ setData()

void Wt::Http::ResponseContinuation::setData ( const cpp17::any &  data)

Set data associated with the continuation.

You could do this to keep track of the state of sending the data for a WResource.

◆ waitForMoreData()

void Wt::Http::ResponseContinuation::waitForMoreData ( )

Wait for more data.

This suspends the handling of this request until more data is available, indicated with a call to haveMoreData(), or to a resource globally using WResource::haveMoreData().