Appfire is a toolkit that provides utilities for quickly building configurable microservices.
Project description
nr.appfire
Appfire is a toolkit that provides utilities for quickly building configurable microservices.
Components
nr.appfire.tasks
This package provides an easy-to-use framework for managing background tasks in a Python application.
Example
from dataclasses import dataclass
from nr.appfire.tasks import Task, TaskManager
@dataclass
class MyTask(Task):
loops: int
def __post_init__(self) -> None:
super().__init__(f'MyTask[loops={self.loops}]')
def run(self) -> None:
for i in range(self.loops):
if self.cancelled():
return
print(i)
self.sleep(1)
manager = TaskManager('MyApp')
manager.queue(MyTask(10))
manager.idlejoin()
Copyright © 2021 Niklas Rosenstein
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
nr.appfire-0.1.0.tar.gz
(9.4 kB
view hashes)
Built Distribution
Close
Hashes for nr.appfire-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a08fa52078105bc5d1110e139d74fe3aeb6b36f76a7aa5f6ae9be10d53a9def |
|
MD5 | dbe67494c1d401bc10c5f0657c79c00b |
|
BLAKE2b-256 | e85e1b956fc4624a627f0818a991865053af7cd6afc76bac550b55fd15d94954 |