Skip to main content

python-gql-worker

Enables running Python functions as standalone jobs based on interaction with valiot-jobs API

installation

pipenv install valiotworker

Deployment:

python setup.py sdist bdist_wheel && python -m twine upload dist/* --skip-existing # UPLOAD TO PYPI

API < v0.4.0

Job footprint:

@valiotWorker.job(...)
def my_job(job_id, update_job, kwargs)
  ...

Parameters:

  • job_id: Number representing the Identifier for this job
  • update_job: function to update status of current job (FINISHED, ERROR, etc)
  • kwargs: dictionary aliasing the custom params (from job's "input" attribute, for retrocompatibility)

API >= v0.5.0

@valiotWorker.job(...)
def my_job(my_arg1, my_arg2, ... my_arg_n, **_)
  ...

Starting from v0.5.0, every argument is accessed by its keyword.

You may have any arbitrary number of arguments which get loaded from the job input parameter, and the special arguments:

  • update_job: function to update status of current job (FINISHED, ERROR, etc)
  • job: dictionary containing job information (id, status, queue, insertion date, etc)
  • queue: dictionary containing Job's parent Queue information (name, type, frequency, etc)
  • kwargs: dictionary aliasing the custom params (from job's "input" attribute, for retrocompatibility)

Worker configuration:

This configurations must run before worker.run() (event loop)

# Poll with subscription
worker.setPollingMode(PollingMode.SUBSCRIPTION)
# or Poll with Queries
worker.setPollingMode(PollingMode.QUERY)

worker.setJobConfigMode(JobConfigMode.KEEP)

# Config remains untouched (Allow persistence of config on DB)
worker.setJobConfigMode(JobConfigMode.KEEP)
# Config updates with job params (Allow quick iteration of job setups)
worker.setJobConfigMode(JobConfigMode.SYNC)

Metadata

Release files for ValiotWorker 6.0.1

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

Source distribution (sdist)

Source distribution for ValiotWorker 6.0.1
File Size Uploaded
ValiotWorker-6.0.1.tar.gz 31.4 kB Details

Built distribution (wheel)

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

Total release size: 70.8 kB

Release files / ValiotWorker-6.0.1.tar.gz

Download URL ValiotWorker-6.0.1.tar.gz
Size 31.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ff55d7b8ef2277ca38e10a88886eabeae4fbf40d206d3b20bad54eb0db0bcf45
BLAKE2b-256 checksum
How to use checksums
87dd0e8ad699d47c0a7de28f09e7b0505555cc99cc06521f6b464b746c7da5f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release files / ValiotWorker-6.0.1-py3-none-any.whl

Download URL ValiotWorker-6.0.1-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b919b6b4f3ff0900471cbc22512036e534aa7dc019e3a1aca96219e6cd90d85
BLAKE2b-256 checksum
How to use checksums
f953d1959de821744951b1e49332b137597d1de03770ff24f70007bd8f71262f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release history Release notifications | RSS feed

This release

6.0.1 This release

2 release files

6.0.0

2 release files

5.3.5

2 release files

5.3.4

2 release files

5.3.3

2 release files

5.3.2

2 release files

5.3.1

2 release files

5.3.0

2 release files

5.2.0

2 release files

5.1.2

2 release files

5.1.1

2 release files

5.1.0

2 release files

5.0.7

2 release files

5.0.6

2 release files

5.0.5

2 release files

5.0.4

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.2.1

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.1

2 release files

3.0.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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