Crates.io | elf_utils |
lib.rs | elf_utils |
version | 0.1.4 |
source | src |
created_at | 2024-07-29 03:53:48.885514 |
updated_at | 2024-08-01 08:53:00.425867 |
description | elf_rust utils |
homepage | |
repository | https://github.com/aprchen/elf_utils |
max_upload_size | |
id | 1318468 |
size | 93,674 |
A tool library based on elf_rust. The default method encapsulates some of my own logic. It can be used as a reference for the use of elf_rust and cloud_task_executor, but don't use it directly unless you and I are in the same company.
Add this to your Cargo.toml
:
[dependencies]
elf_utils = "0.1.4"
use log::info;
use serde_json::Value;
use elf_utils::*;
async fn my_task(_ctx: Context, payload: Value) -> Result<String, String> {
info!("Task running with sample value: {:?}",payload);
Ok("Task result".to_string())
}
#[tokio::main]
async fn main() {
default_handle_script("my_task", my_task).await;
}