summaryrefslogtreecommitdiff
path: root/runtime/ops/process.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-03-14 23:14:15 +0530
committerGitHub <noreply@github.com>2022-03-14 18:44:15 +0100
commitb4e42953e1d243f2eda20e5be6b845d60b7bf688 (patch)
tree10b3bfff165f9c04f9174c7c399d44b9b724c3b3 /runtime/ops/process.rs
parent4e3ed37037a2aa1edeac260dc3463a81d9cf9b88 (diff)
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
Diffstat (limited to 'runtime/ops/process.rs')
-rw-r--r--runtime/ops/process.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs
index eee266986..7c45c47fc 100644
--- a/runtime/ops/process.rs
+++ b/runtime/ops/process.rs
@@ -8,8 +8,8 @@ use crate::permissions::Permissions;
use deno_core::error::bad_resource_id;
use deno_core::error::type_error;
use deno_core::error::AnyError;
-use deno_core::op_async;
-use deno_core::op_sync;
+use deno_core::op;
+
use deno_core::AsyncMutFuture;
use deno_core::AsyncRefCell;
use deno_core::Extension;
@@ -29,11 +29,7 @@ use std::os::unix::process::ExitStatusExt;
pub fn init() -> Extension {
Extension::builder()
- .ops(vec![
- ("op_run", op_sync(op_run)),
- ("op_run_status", op_async(op_run_status)),
- ("op_kill", op_sync(op_kill)),
- ])
+ .ops(vec![op_run::decl(), op_run_status::decl(), op_kill::decl()])
.build()
}
@@ -102,6 +98,7 @@ struct RunInfo {
stderr_rid: Option<ResourceId>,
}
+#[op]
fn op_run(
state: &mut OpState,
run_args: RunArgs,
@@ -226,6 +223,7 @@ struct ProcessStatus {
exit_signal: i32,
}
+#[op]
async fn op_run_status(
state: Rc<RefCell<OpState>>,
rid: ResourceId,
@@ -303,6 +301,7 @@ pub fn kill(pid: i32, signal: &str) -> Result<(), AnyError> {
}
}
+#[op]
fn op_kill(
state: &mut OpState,
pid: i32,