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. } }
void cancel(std::string cause = "manually stopped") { state.synchronize()->reset(new state::stopped_t(std::move(cause))); }
dynamic_t info(app_t::info_policy_t policy) const { return (*state.synchronize())->info(policy); }