Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

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

Project description

python-gql-worker

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

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)

Project details


Download files

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

Files for ValiotWorker, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size ValiotWorker-1.2.0-py3-none-any.whl (24.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ValiotWorker-1.2.0.tar.gz (20.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page