js effect for subscribing to config

fix errors

chore: Fix some things in the manager for clippy
This commit is contained in:
Aiden McClelland
2023-02-01 16:53:25 -07:00
parent 93c751f6eb
commit bec307d0e9
18 changed files with 223 additions and 168 deletions

View File

@@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
async-trait = "0.1.64"
color-eyre = "0.6.2"
futures = "0.3.21"
lazy_async_pool = "0.3.3"

View File

@@ -10,10 +10,12 @@ use tokio::sync::oneshot;
use tokio::task::{JoinError, JoinHandle, LocalSet};
mod byte_replacement_reader;
mod os_api;
mod rpc_client;
mod rsync;
mod script_dir;
pub use byte_replacement_reader::*;
pub use os_api::*;
pub use rpc_client::{RpcClient, UnixRpcClient};
pub use rsync::*;
pub use script_dir::*;

View File

@@ -0,0 +1,17 @@
use models::Error;
use models::PackageId;
use serde_json::Value;
pub struct RuntimeDropped;
pub type Callback = Box<dyn Fn(Value) -> Result<(), RuntimeDropped> + Send + Sync + 'static>; // bool indicating if
#[async_trait::async_trait]
pub trait OsApi: Send + Sync + 'static {
async fn get_service_config(
&self,
id: PackageId,
path: &str,
callback: Callback,
) -> Result<Value, Error>;
}