Skip to main content

Task DB

Project description

TaskDB runs common methods in a single thread

Motivation

Threads sometimes need to run compute-heavy or network-heavy methods that are expected to return a similar output. Webcrawlers and bots acting on those crawlers may wish to decrease network load by limiting requests to a single thread. TaskDB allows multiple threads to ask for the result of a common function without requiring each thread to execute the function.

Installation

Install this package through pip:

$ pip install taskdb

Basic Usage

from taskdb import TaskDB

def some_intesive_method(some_argument, some_other_argument):
    # Do something

task_db = TaskDB()
result = task_db.monitor('SOME_TASK_ID', some_intensive_method, (15, 20))
print(result)

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

taskdb-0.0.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file taskdb-0.0.1.tar.gz.

File metadata

  • Download URL: taskdb-0.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for taskdb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 42cecef1c6e3b004b0176442a4848829f41d160d5493b67b7790030152aaad0d
MD5 f1405fc39d6653d27b6a3052819b6a65
BLAKE2b-256 14daebf493d62b567067161cb378108001d53aa8f88202687f20732537e9e3d6

See more details on using hashes here.

Supported by

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