Wt: Wt::Http::ResponseContinuation Class Reference

Wt 3.3.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions
Wt::Http::ResponseContinuation Class Reference
HTTP protocol (Wt::Http)

A resource response continuation object. More...

`#include <Wt/Http/ResponseContinuation>`

List of all members.

## Public Member Functions
void | setData (const boost::any &data)
| Set data associated with the continuation.
boost::any | data ()
| Return data associated with the continuation.
WResource * | resource () const
| Return the resource.
void | waitForMoreData ()
| Wait for more data.
bool | isWaitingForMoreData () const
| Returns whether this continuation is waiting for data.

## 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:

- the entire response is quite big and you may want to read and send it in smaller chunks. This avoids unbounded memory usage since the I/O layer buffers the response first in memory to send it then out to a possibly slow client using async I/O.
- you may not have any more data available, currently, but expect more data later. In that case you can call waitForMoreData() and later call WResource::haveMoreData() when more data is available.

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

## Member Function Documentation

boost::any Wt::Http::ResponseContinuation::data | ( |  | ) |

Return data associated with the continuation.

See also:
  setData()

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

Returns whether this continuation is waiting for data.

See also:
  waitForMoreData()

void Wt::Http::ResponseContinuation::setData | ( | const boost::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.

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

Wait for more data.

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

All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator