restbench-handlers: Default handlers to process incoming requests

Description Usage Arguments Value

Description

run_task

schedules batch jobs and put them to a running list

handler_unpack_task

unpack a request and convert to a task

handler_query_task

obtain task status on the server

handler_validate_server

handles validation request

handler_validate_auth

a layer that handles authentication

Usage

1
2
3
4
5
6
7
8
9
run_task(task, userid)

handler_unpack_task(req)

handler_query_task(userid, status = "valid")

handler_validate_server(req)

handler_validate_auth(req, res)

Arguments

task

a task instance

userid

which user submits the task

req, res

web request/response variables (see 'plumber' package)

status

task status to filter/query; choices are 'valid', 'init' (submitted, waiting to run), 'running' (running task), 'finish' (finished task), and 'canceled' (canceled by the server)

Value

run_task returns a named list with:

task

task object created by internal new_task function

userid

a 32-character string of user's ID

future

a future object that schedules jobs asynchronously

. handler_unpack_task, handler_query_task return task instances created by the internal new_task function. Others return lists or res that will be processed by the 'plumber' package.


dipterix/restbatch documentation built on Oct. 13, 2021, 8:58 a.m.