Function call

Source
pub async fn call(
    scheduler_url: &str,
    method: &str,
    params: Value,
) -> Result<Value>
Expand description

Calls a remote method on the scheduler

This function provides a simple interface for making remote method calls to the scheduler. It handles task execution and result retrieval automatically.

§Arguments

  • scheduler_url - The HTTP URL of the scheduler
  • method - The name of the method to call
  • params - The parameters to pass to the method

§Returns

A Result containing the method result or an error

§Example

use go_server_rust_sdk::worker::call;
use serde_json::json;
 
let result = call(
    "http://localhost:8080",
    "add",
    json!({"a": 1, "b": 2})
).await?;
 
println!("Result: {}", result);