Crates.io | long-running-task |
lib.rs | long-running-task |
version | 0.1.1 |
source | src |
created_at | 2024-04-29 10:23:42.194878 |
updated_at | 2024-04-29 12:24:20.317705 |
description | Handle long-running tasks for your RESTful HTTP API |
homepage | |
repository | https://github.com/thomas-zahner/long-running-task |
max_upload_size | |
id | 1224056 |
size | 21,401 |
A simple library to handle long-running tasks.
When exposing RESTful HTTP API paths to clients which trigger slow and/or computationally expensive operations it is best practice to make use of the long-running task concept.
When making use of this concept a single endpoint, which blocks until the operation is completed,
is replaced with two endpoints. The first endpoint is used start the task.
The second endpoint is used to get the state of the running task.
It may be in progress (Pending
) or may be completed (Done
).
This crate helps to manage and keep track of long-running tasks.
serde
feature to make tasks serialisable and use them in combination with a web-frameworksTake a look at the Rocket example to learn how to design REST API endpoints for long-running tasks.