示例#1
0
    void
    publish() {
        try {
            state.synchronize()->reset(
                new state::running_t(context, manifest(), profile, log.get(), loop)
            );
        } catch (const std::exception& err) {
            COCAINE_LOG_ERROR(log, "unable to publish app: %s", err.what());
            cancel(err.what());
        }

        // Attempt to finish node service's request.
        try {
            deferred.close();
        } catch (const std::exception&) {
            // Ignore if the client has been disconnected.
        }
    }
示例#2
0
 void
 cancel(std::string cause = "manually stopped") {
     state.synchronize()->reset(new state::stopped_t(std::move(cause)));
 }
示例#3
0
 dynamic_t
 info(app_t::info_policy_t policy) const {
     return (*state.synchronize())->info(policy);
 }