Skip to main content

ICIJ's async worker library Test for icij-worker

Installation

With AMQP:

pip install icij-worker["amqp"]

With neo4j:

pip install icij-worker["neo4j"]

Usage

Create an async app and register tasks

Create asynchronous task tailored for long running Python functions:

Given the following pure Python function inside the app.py module:

def long_running_task(greeted: str) -> str:
    greeting = f"Hello {greeted} !"
    return greeting

decorate your function with ICIJApp class and register a new task:

from icij_worker import AsyncApp

my_app = AsyncApp(name="my_app")

@my_app.task
def long_running_task(greeted: str) -> str:
    greeting = f"Hello {greeted} !"
    return greeting

this will register the long_running_task function under the long_running_task task name.

Optionally add progress handlers for a better task monitoring:

@my_app.task
async def long_running_task(
    greeted: str,
    progress: Optional[Callable[[float], Awaitable]] = None
) -> str:
    if progress is not None:
        await progress(0.0)
    greeting = f"Hello {greeted} !"
    if progress is not None:
        await progress(100.0)
    return greeting

Launch a async worker pool

Start a worker pool using:

icij-worker workers start "app.my_app"

provide worker pool options using:

icij-worker workers start -c worker_config.json -n 2 --backend multiprocessing "app.my_app"

depending on the worker configuration additional setup might be required.

Async worker implementations

Worker asynchronous backends

Implemented

To be implemented

Download files

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

Source Distribution

icij_worker-0.20.0.tar.gz (59.8 kB view details)

Uploaded Source

Built Distribution

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

icij_worker-0.20.0-py3-none-any.whl (85.2 kB view details)

Uploaded Python 3

File details

Details for the file icij_worker-0.20.0.tar.gz.

File metadata

  • Download URL: icij_worker-0.20.0.tar.gz
  • Upload date:
  • Size: 59.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.7

File hashes

Hashes for icij_worker-0.20.0.tar.gz
Algorithm Hash digest
SHA256 4ae18243274651f205330eed7550519c21199938b8dfde45b564c3e43987a4bf
MD5 de6649825f7ee2e0613fc591cfcb94b7
BLAKE2b-256 314613462dffc9f6cc9cea3cfe38539b2371a6137e240fdafe7559ea2664ba05

See more details on using hashes here.

File details

Details for the file icij_worker-0.20.0-py3-none-any.whl.

File metadata

File hashes

Hashes for icij_worker-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3e325a12a634d0a67baeae940bec2e6c534cb184a68d34c67e8495269207222
MD5 40c573f03ecf8c36213e54a5c8c49324
BLAKE2b-256 7a61a6660f4c1913cf90a64c19d67aca422c031676761acc683b7684a6d61859

See more details on using hashes here.

Release history Release notifications | RSS feed

0.20.2

2 files

0.20.1

2 files

This release

0.20.0 This release

2 files

0.19.5

2 files

0.19.4

2 files

0.19.3

2 files

0.19.2

2 files

0.19.1

2 files

0.18.3

2 files

0.18.2

2 files

0.18.1

2 files

0.18.0

2 files

0.17.21

2 files

0.17.20

2 files

0.17.19

2 files

0.17.18

2 files

0.17.17

2 files

0.17.16

2 files

0.17.15

2 files

0.17.14

2 files

0.17.13

2 files

0.17.12

2 files

0.17.11

2 files

0.17.10

2 files

0.17.9

2 files

0.17.8

2 files

0.17.7

2 files

0.17.6

2 files

0.17.5

2 files

0.17.4

2 files

0.17.3

2 files

0.17.2

2 files

0.17.1

2 files

0.17.0

2 files

0.16.1

2 files

0.16.0

2 files

0.15.1

2 files

0.15.0

2 files

0.14.3

2 files

0.14.2

2 files

0.14.1

2 files

0.14.0

2 files

0.13.7

2 files

0.13.6

2 files

0.13.5

2 files

0.13.3

2 files

0.13.2

2 files

0.13.1

2 files

0.13.0

2 files

0.12.0

2 files

0.11.65

2 files

0.11.21

2 files

0.11.20

2 files

0.11.19

2 files

0.11.18

2 files

0.11.17

2 files

0.11.16

2 files

0.11.15

2 files

0.11.14

2 files

0.11.13

2 files

0.11.12

2 files

0.11.11

2 files

0.11.10

2 files

0.11.9

2 files

0.11.8

2 files

0.11.7

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.10

2 files

0.9.9

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 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