Skip to main content

sow-and-sub-paginated

Including the basic AMPS library:

#include <amps/ampsplusplus.hpp>

Constructing the command:

AMPS::Command cmd(AMPS::Message::Command::SOWAndSubscribe);
cmd.setTopic(topic).setOrderBy("/id DESC");

AMPS::Message::Options opts;
opts.setOOF();
opts.setTopN(20);
opts.setSkipN(20);
// set other options as needed

cmd.setOptions(opts);

The command can now be used in execute or executeAsync.