← Back

ofxContinuable

github.com/ffunatsu/ofxContinuable · @ffunatsu
OF 0.12 Utilities

continuable for openFrameworks

1 0 Last commit 1y ago Created 1y ago

README

ofxContinuable



continuable for openFrameworks (tested on v0.12.0, continuable version: 4.2.2)

Usage



See example. (Please use projectGenerator before run it)

#include "continuable.hpp"

inline cti::continuable<std::string> start_greetings(std::string) {
  return cti::make_ready_continuable<std::string>("world");
}

//--------------------------------------------------------------
void ofApp::setup(){
    ofLogToConsole();

    start_greetings("hello")
        .then([](std::string response) {
            ofLogNotice("ofApp") << "hello: " << response;
        })
        .then([]() {
            ofLogNotice("ofApp") << "waiting for 200ms";
            ofSleepMillis(200);
        })
        .then([]() {
            ofLogNotice("ofApp") << "done";
        });

    ofLogNotice("ofApp") << "normal log test";
}

// Result:
// [notice ] ofApp: hello: world
// [notice ] ofApp: waiting for 200ms
// [notice ] ofApp: done
// [notice ] ofApp: normal log test


LICENSE



NOTE: No specific copyright is claimed for this repository changes (for oF binding), but the Apache License 2.0 or MIT License can be applied if necessary.

Get this addon

HTTPS
SSH