Skip to main content

Tool to build CLI like web application

Project description

Index

Concepts

Async Action

An async action, like the name implies, prepresent an async action.

  • When an async action is created, request field stores the context on what is action is about. It is a JSON object.
  • When an async action is completed -- either successfully or failed, the response field store the action result. It is a JSON object
  • Once an async action is created, before it is completed, you can update the progress information, it is stored in progress field. It is a JSON field.

APIs

CLIHandler

NameAsyncDescription
async_start_async_action YES Create an async action. It returns a tuple of status and async action being created. status type is AsyncActionOpStatus. If async action is created successfully, status will be AsyncActionOpStatus.OK, and an async action will be returned, the returned async action has already been saved to database.

CLIHandler rely on a list of customer defined handlers to handle the request. handler's can_handle method looks at the action's request and judge if it can handle it or not.

Once an async action is created, the handler's handle method has been scheduled in a threadpool. The handler's handle method is suppose to take care of the execution of the async action

Here is a list of possible status based on status
Status Reason
OK The async action has been created, the AsyncAction object is returned. The customer action handler's handle method has been scheduled in a thread pool
SHUTDOWN_IN_PROGRESS This means the CLIHandler is in the progress of shutdown and does not serve creating new async actions.
NO_HANDLER Cannot find a handler that can handle this async action. You need to make sure when you create CLIHandler, action_handlers is set properly
DB_FAILED Cannot save the async action to database, probably check your DB configuration and connectivity
async_update_progress_async_action YES Update an async ation's progress, wake up all monitoring client against this async action.

Here is a list of possible status based on status
Status Reason
OK The async action has been updated, all monitoring client against this async action has been woken up
NOT_FOUND The async action is not found based on the action ID caller provided.
ACTION_COMPLETED The async action has already been completed
DB_FAILED Cannot save the progress for the action to database, probably check your DB configuration and connectivity
async_complete_async_action YES Complete an async ation and set it's result, wake up all monitoring client against this async action.

Here is a list of possible status based on status
Status Reason
OK The async action has been completed, all monitoring client against this async action has been woken up
NOT_FOUND The async action is not found based on the action ID caller provided.
ACTION_COMPLETED The async action has already been completed
DB_FAILED Cannot save the progress for the action to database, probably check your DB configuration and connectivity

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webcli2-0.0.2.tar.gz (68.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webcli2-0.0.2-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file webcli2-0.0.2.tar.gz.

File metadata

  • Download URL: webcli2-0.0.2.tar.gz
  • Upload date:
  • Size: 68.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for webcli2-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5404af4071dc1c9b36a17fa2abfa77fc761128cb91f74a0649e970bb5d7e03c2
MD5 773cd315e1b5beb5f0bf9fbf3eccdd0c
BLAKE2b-256 ec22945c1b42e831043688925cb0aac9a5c2bed3b1fed334f046cf142f92c558

See more details on using hashes here.

File details

Details for the file webcli2-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: webcli2-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.12

File hashes

Hashes for webcli2-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81ce9d468a26207f81c487cb4657ce4229d7866396d30aecc90a4c4c2b9446d3
MD5 f117f6e3b18a2eeb87000f481e380c90
BLAKE2b-256 01ceeabc6cf8fc11f6e0ec609a11792e2ae25282c9aa6e19299cd22fccd67b6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page