API Reference

POST /apply-async/(.*)/

Apply tasks asynchronously by sending a message

Example request:

POST /apply-async/examples.tasks.add/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, compress
Content-Length: 16
Content-Type: application/json; charset=utf-8
Host: localhost:8888
User-Agent: HTTPie/0.8.0

{
    "args": [
        1,
        2
    ]
}

Example response:

HTTP/1.1 200 OK
Content-Length: 71
Content-Type: application/json; charset=UTF-8
Server: TornadoServer/3.2

{
    "state": "PENDING",
    "task-id": "1c9be31f-3094-4319-8895-ad2f0654c699"
}
Status Codes:
GET /tasks/result/(.*)/

Get task result by task-id

Example request:

GET /tasks/result/9ec42ba0-be59-488f-a445-4a007d83b954/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, compress
Content-Type: application/json; charset=utf-8
Host: localhost:8888
User-Agent: HTTPie/0.8.0

Example response:

HTTP/1.1 200 OK
Content-Length: 84
Content-Type: application/json; charset=UTF-8
Etag: "0aef8448588cf040f1daa7a0244c0a7b93abfd71"
Server: TornadoServer/3.2

{
    "result": 3,
    "state": "SUCCESS",
    "task-id": "9ec42ba0-be59-488f-a445-4a007d83b954"
}
Status Codes:
DELETE /tasks/revoke/(.*)/

Revoke a task

Example request:

DELETE /tasks/revoke/d776e835-33ac-447f-b27d-bb8529718ae6/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, compress
Content-Length: 0
Content-Type: application/json; charset=utf-8
Host: localhost:8888
User-Agent: HTTPie/0.8.0

Example response:

HTTP/1.1 200 OK
Content-Length: 51
Content-Type: application/json; charset=UTF-8
Server: TornadoServer/3.2

{
    "task-id": "d776e835-33ac-447f-b27d-bb8529718ae6"
}
Status Codes:
POST /apply/(.*)/

Apply tasks synchronously. Function returns when the task is finished

Example request:

POST /apply/examples.tasks.add/ HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, compress
Content-Length: 16
Content-Type: application/json; charset=utf-8
Host: localhost:8888
User-Agent: HTTPie/0.8.0

{
    "args": [
        1,
        2
    ]
}

Example response:

HTTP/1.1 200 OK
Content-Length: 84
Content-Type: application/json; charset=UTF-8
Server: TornadoServer/3.2

{
    "result": 3,
    "state": "SUCCESS",
    "task-id": "2ce70595-a028-4e0d-b906-be2183fc6821"
}
Status Codes: