简体   繁体   English

Google App Engine-如何部署持续运行的代码?

[英]Google App Engine - How to deploy constantly running code?

Sorry for the poor title but I couldn't think how else to word it. 对不起,标题很抱歉,但我想不起来怎么写。

I've deployed an application to Google App Engine which uses servlets to service requests to my server's URI. 我已将一个应用程序部署到Google App Engine,该应用程序使用servlet来服务对服务器URI的请求。 The servlets are instantiated on-demand by the container but I haven't seen anything in the documentation about how to deploy code which just runs constantly in the background (ie the equivalent of a main method which runs upon deployment for lack of a better explanation) which can be referenced by the servlets. 这些servlet是由容器按需实例化的,但是我没有在文档中看到有关如何部署在后台不断运行的代码的任何信息(即,缺少更好解释的在部署时运行的main方法的等效方法) ),可以由servlet引用。 I'd appreciate it if anyone could point me in the right direction. 如果有人能指出正确的方向,我将不胜感激。 Thanks 谢谢

  1. Deploy your code as a new version. 将代码部署为新版本。
  2. Spin up new instances. 启动新实例。
  3. Change the default version to the new one. 将默认版本更改为新版本。
  4. Shut down old instances. 关闭旧实例。

It is your responsibility to make sure that your code shuts down gracefully. 您有责任确保您的代码正常关闭。

Note that new and old instances still share Memcache/datastore, which you can use to pass any data that is necessary for seamless transition. 请注意,新旧实例仍然共享Memcache /数据存储,可用于传递无缝过渡所需的任何数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM