Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 128 additions & 128 deletions api/cluster/cluster.capnp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 26 additions & 10 deletions api/process.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,18 @@ $Go.import("github.com/wetware/pkg/api/process");
interface Executor {
# Executor has the ability to create and run WASM processes given the
# WASM bytecode.
exec @0 (bytecode :Data, ppid :UInt32, bootstrapClient :Capability) -> (process :Process);
exec @0 (bytecode :Data, ppid :UInt32, bctx :BootContext) -> (process :Process);
# Exec creates an runs a process from the provided bytecode. Optionally, a
# capability can be passed through the `cap` parameter. This capability will
# be available at the process bootContext.
#
# The Process capability is associated to the created process.
execCached @1 (cid :Text, ppid :UInt32, bootstrapClient :Capability) -> (process :Process);
execCached @1 (cid :Text, ppid :UInt32, bctx :BootContext) -> (process :Process);
# Same as Exec, but the bytecode is directly from the BytecodeRegistry.
# Provides a significant performance improvement for medium to large
# WASM streams.
}

interface Process {
# Process is a points to a running WASM process.
wait @0 () -> (exitCode :UInt32);
# Wait until a process finishes running.
kill @1 () -> ();
# Kill the process.
}

interface BytecodeCache {
# BytecodeCache is used to store WASM byte code. May be implemented with
# anchors or any other means.
Expand All @@ -39,3 +31,27 @@ interface BytecodeCache {
has @2 (cid :Text) -> (has :Bool);
# Has returns true if a bytecode identified by the cid has been previously stored.
}

interface Process {
# Process is a points to a running WASM process.
wait @0 () -> (exitCode :UInt32);
# Wait until a process finishes running.
kill @1 () -> ();
# Kill the process.
}

interface BootContext {
# Every process is given a BootContext containing the arguments and capabilitis
# passed by the parent process.
pid @0 () -> (pid :UInt32);
# PID of the process.
cid @1 () -> (cid :Text);
# CID of the process bytecode.
args @2 () -> (args :List(Text));
# CLI arguments.
caps @3 () -> (caps :List(Capability));
# Capabilities.

setPid @4 (pid :UInt32) -> ();
setCid @5 (cid :Text) -> ();
}
Loading