Skip to main content

Small boiler plate with tools for multithreading.

Project description

Check Deploy

minibone

Minibone is a set of common classes for:

  • Multithreading
  • Among others (I will add more later)

Deployed on PyPi

A deploy to PyPi will be triggered on each release for minibone package

Installation

$ pip install minibone

Usage

Daemon

It is just another python class to do jobs / tasks in the background

Usage

  • Subclass Daemon
  • call super().init() in yours
  • Overwrite on_process method with yours
  • Add logic you want to run inside on_process
  • Be sure your methods are safe-thread to avoid race condition
  • self.lock is available for lock.acquire / your_logic / lock.release
  • call start() method to keep running on_process in a new thread
  • call stop() to finish the thread

Check sample_clock.py for a sample

Usage callback mode

  • Instance Daemon by passing a callable
  • Add logic to your callable method
  • Be sure your callable and methods are safe-thread to avoid race condition
  • call start() method to keep running callable in a new thread
  • call stop() to finish the thread

Check sample_clock_callback.py for a sample

Contribution

  • Feel free to clone this repository, and send any pull request.
  • Add issues if something is not working as expected.

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

minibone-0.0.4.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

minibone-0.0.4-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file minibone-0.0.4.tar.gz.

File metadata

  • Download URL: minibone-0.0.4.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for minibone-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7f2ae1068f4c677f4ffac9e4f7cfdef97e21c5ae70e129cb981c7925fa5980d0
MD5 01d89784179c0fd18ffacd70eb79b9f8
BLAKE2b-256 aebec560e986df535811b47286b8e7d30e271fef0161457fb9d4b4ba8551f367

See more details on using hashes here.

File details

Details for the file minibone-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: minibone-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 29.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for minibone-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dcc1df0f4602490a8e6f636e36a09f2ff610b5afd003056c0555be79cba612a7
MD5 219916176a9f2dae44448c1ba97ad41f
BLAKE2b-256 a557b5e8415e7359cff8820e99f6b47489da2f7632b860c164224b5ba27c07be

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