Skip to main content

FunTask

PyPI - Version PyPI - Python Version


FunTask is a Python framework for stateful functional task dispatching and execution

  • lightweight and easy
  • scalable and distributed
  • stateful
  • task is just a function(status, ...args)
  • observable
from funtask import LocalFunTaskManager, StdLogger, TaskStatus
from typing import List
import asyncio

ft = LocalFunTaskManager(StdLogger())

# increase 10 worker(in different processes) with state: ['new_state']
workers = ft.increase_workers(lambda old_state: ['new_state'], 10)

def function_task(state: List[str], logger: StdLogger, *args):
    state.append("change and visit state in func task")
    logger.log(f"current state is {state}, args: '{' '.join(args)}'")
    return "I'm task result"

# will dispatch function_task to worker0
task = workers[0].dispatch_fun_task(function_task, "i'm", "arguments")

# async wait task result
task_result = asyncio.run(task.get_result())

assert task_result == "I'm task result"
assert task.status is TaskStatus.SUCCESS
print("end.")

Table of Contents

Installation

not support for now

pip install funtask

License

funtask is distributed under the terms of the MIT license.

Features

  • local multiprocessing scheduler
  • k8s + celeary task scheduler
  • flet webUI

Release files for funtask 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for funtask 0.0.4
File Size Uploaded
funtask-0.0.4.tar.gz 21.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for funtask 0.0.4
File Interpreter ABI Platform
funtask-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 MB

Release files / funtask-0.0.4.tar.gz

Download URL funtask-0.0.4.tar.gz
Size 21.1 MB
Tags Source
SHA-256 checksum
How to use checksums
85776ebebe7a62fa6b6bfaede87b19e8533fd12dbc937b8b5ba60b9da65300e0
BLAKE2b-256 checksum
How to use checksums
0844e330a02535afc23fad7ce1a0ed585fadbecbdc0f624051449542cb3cf21e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / funtask-0.0.4-py3-none-any.whl

Download URL funtask-0.0.4-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
621e3be792d2605f067a54a9dc55e8a54bc942e3875b801a295ed04950293b1b
BLAKE2b-256 checksum
How to use checksums
98d4b0402eb1af153e2bdf8e201f57c80eda9772afdebb189ac519915f3dac1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page