Como testar filas push no servidor de desenvolvimento
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, descrevemos algumas limitações no uso do servidor de desenvolvimento local
(dev_appserver) para o teste de filas push no aplicativo. Na maior parte,
você configura as filas e tarefas como faria para executá-las no
ambiente de produção do App Engine, mas há algumas diferenças:
O servidor de desenvolvimento não respeita os atributos rate e bucket-size
de suas filas. Desse modo, as tarefas são executadas o mais próximo possível do ETA. A configuração de uma taxa 0 não impede que tarefas sejam executadas automaticamente.
O servidor de desenvolvimento não preserva o estado da fila durante reinicializações.
Para evitar que tarefas push sejam executadas no servidor de desenvolvimento, use o seguinte comando:
python2 DEVAPPSERVER_ROOT/google_appengine/dev_appserver.py --enable_task_running no
Substitua DEVAPPSERVER_ROOT pelo caminho para a pasta em que você
extrai a versão arquivada de devapp_server.py. Para mais informações sobre
como fazer o download e usar a versão arquivada de dev_appserver.py, consulte Como usar o servidor de desenvolvimento local.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eThis API is compatible with first-generation runtimes and can be used when upgrading to second-generation runtimes, with a migration guide available for App Engine Go 1.12+ runtimes.\u003c/p\u003e\n"],["\u003cp\u003eThe local development server (\u003ccode\u003edev_appserver\u003c/code\u003e) behaves similarly to the App Engine production environment for setting up queues and tasks but has some limitations.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edev_appserver\u003c/code\u003e ignores the \u003ccode\u003erate\u003c/code\u003e and \u003ccode\u003ebucket-size\u003c/code\u003e attributes, causing tasks to execute close to their ETA, and does not maintain queue state across restarts.\u003c/p\u003e\n"],["\u003cp\u003eTo completely prevent push tasks from running on the development server, use the command \u003ccode\u003epython2 <var translate="no">DEVAPPSERVER_ROOT</var>/google_appengine/dev_appserver.py --enable_task_running no\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBefore running the local development server, you must follow setup instructions, run \u003ccode\u003edev_appserver.py\u003c/code\u003e with Python 3, and set the \u003ccode\u003eCLOUDSDK_DEVAPPSERVER_PYTHON\u003c/code\u003e environment variable to the path of your Python 2 interpreter.\u003c/p\u003e\n"]]],[],null,["# Testing Push Queues in the Development Server\n\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nThis page describes some limitations with using the local development server\n(`dev_appserver`) to test push queues in your application. In most\nrespects, you set up your queues and tasks just as you would to run them in the\nApp Engine production environment, but there are some differences:\n\n- The development server doesn't respect the `rate` and `bucket-size` attributes of your queues. As a result, tasks are executed as close to their ETA as possible. Setting a rate of `0` doesn't prevent tasks from being executed automatically.\n- The development server doesn't preserve queue state across restarts.\n\n| **Important:** Before running the local development server, follow the [setup instructions](/appengine/docs/legacy/standard/go111/tools/using-local-server#set-up). Regardless of your app's runtime or language version, you must run `dev_appserver.py` with Python 3 and set the `CLOUDSDK_DEVAPPSERVER_PYTHON` environment variable in your shell to the path of your Python 2 interpreter.\n\nTo prevent push tasks from running in the development server at all, use the\nfollowing command: \n\n python2 \u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e/google_appengine/dev_appserver.py --enable_task_running no\n\nReplace \u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e with the path to the folder where you\nextract the archived version of `devapp_server.py`. For more information about\ndownloading and using the archived version of `dev_appserver.py`, see [Using the local development server](/appengine/docs/legacy/standard/go111/tools/using-local-server#before_you_begin).\n\nFor more information about `devapp_server.py` command options, see\n[Local development server options](/appengine/docs/legacy/standard/go111/tools/local-devserver-command)."]]