feat: update with web assembly components
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
30
crates/churn/src/agent/actions/plugin_task.rs
Normal file
30
crates/churn/src/agent/actions/plugin_task.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use crate::agent::{plugins::PluginStore, task::Task};
|
||||
|
||||
pub struct PluginTask {
|
||||
plugin: String,
|
||||
store: PluginStore,
|
||||
}
|
||||
|
||||
impl PluginTask {
|
||||
pub fn new(plugin: impl Into<String>, store: PluginStore) -> Self {
|
||||
Self {
|
||||
plugin: plugin.into(),
|
||||
store,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl Task for PluginTask {
|
||||
async fn id(&self) -> anyhow::Result<String> {
|
||||
let id = self.store.id(&self.plugin).await?;
|
||||
|
||||
Ok(id)
|
||||
}
|
||||
|
||||
async fn execute(&self) -> anyhow::Result<()> {
|
||||
self.store.execute(&self.plugin).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user