Skip to content

funatsufumiya/ofxContinuable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ofxContinuable

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

  • also includes function2 (4.2.4) as a dependency

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.

About

continuable for openFrameworks

Topics

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.md
Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published