Request handling module

This module documents most elements of a processing request.

class VestaService.request.Request(body, task_handler, required_args=None, download=True)

Container class for all attributes relative to an annotation request. An instance of this class is meant to exist only during the processing of a request. (Hence it’s name).

Also offers general helper functions in the context of the Vesta workgroup annotators. (Can be used elsewhere also).

set_progress(progress)

Helper function to set the progress state in the Celery Task backend.

Parameters:progress (int) – Progress value between 0 and 100.
store_annotations(annotations)

Store the annotations on an Annotation Storage Service (JASS) if the JASS’s URL was specified in the request body and the annotation has a valid result (not Null).

Creates a transitory state which is called STORING which can be used to debug a hanging call to the JASS.

Parameters:annotations – Actual annotations to send to the JASS.
VestaService.request.postrun_handler(task_id, state, **kwargs)

This function will call a caller-supplied callback URL when the celery processing finishes.

Parameters:
  • state – State of the task upon completion.
  • task_id – UUID of the task.