Documentation ¶
Overview ¶
Package csp provides primitives for communicating sequential processes
Index ¶
- Variables
- type BootContext
- func (b *BootContext) Args(ctx context.Context, call api.BootContext_args) error
- func (b *BootContext) Cap() api.BootContext
- func (b *BootContext) Caps(ctx context.Context, call api.BootContext_caps) error
- func (b *BootContext) Cid(ctx context.Context, call api.BootContext_cid) error
- func (b *BootContext) Empty() *BootContext
- func (b *BootContext) Pid(ctx context.Context, call api.BootContext_pid) error
- func (b *BootContext) SetCid(ctx context.Context, call api.BootContext_setCid) error
- func (b *BootContext) SetPid(ctx context.Context, call api.BootContext_setPid) error
- func (b *BootContext) WithArgs(args ...string) *BootContext
- func (b *BootContext) WithCaps(caps ...capnp.Client) (*BootContext, error)
- func (b *BootContext) WithCid(cid cid.Cid) *BootContext
- func (b *BootContext) WithPid(pid uint32) *BootContext
- func (b *BootContext) WithRawArgs(args capnp.TextList) *BootContext
- func (b *BootContext) WithRawCaps(caps capnp.PointerList) *BootContext
- type BootCtx
- func (b BootCtx) Args(ctx context.Context) ([]string, error)
- func (b BootCtx) Caps(ctx context.Context) ([]capnp.Client, error)
- func (b BootCtx) Cid(ctx context.Context) (cid.Cid, error)
- func (b BootCtx) Pid(ctx context.Context) (uint32, error)
- func (b BootCtx) SetCid(ctx context.Context, cid cid.Cid) error
- func (b BootCtx) SetPid(ctx context.Context, pid uint32) error
- type ByteCode
- type Cache
- type Executor
- func (ex Executor) AddRef() Executor
- func (ex Executor) Exec(ctx context.Context, bc []byte, ppid uint32, bCtx api.BootContext) (Proc, capnp.ReleaseFunc)
- func (ex Executor) ExecFromCache(ctx context.Context, cid cid.Cid, ppid uint32, bCtx api.BootContext) (Proc, capnp.ReleaseFunc)
- func (ex Executor) Release()
- type Proc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRunning = errors.New("running") ErrNotStarted = errors.New("not started") )
Functions ¶
This section is empty.
Types ¶
type BootContext ¶
type BootContext struct {
// contains filtered or unexported fields
}
BootContext implements api.BootContext.
func NewBootContext ¶
func NewBootContext() *BootContext
func (*BootContext) Args ¶
func (b *BootContext) Args(ctx context.Context, call api.BootContext_args) error
func (*BootContext) Cap ¶
func (b *BootContext) Cap() api.BootContext
func (*BootContext) Caps ¶
func (b *BootContext) Caps(ctx context.Context, call api.BootContext_caps) error
func (*BootContext) Cid ¶
func (b *BootContext) Cid(ctx context.Context, call api.BootContext_cid) error
func (*BootContext) Empty ¶
func (b *BootContext) Empty() *BootContext
func (*BootContext) Pid ¶
func (b *BootContext) Pid(ctx context.Context, call api.BootContext_pid) error
func (*BootContext) SetCid ¶
func (b *BootContext) SetCid(ctx context.Context, call api.BootContext_setCid) error
func (*BootContext) SetPid ¶
func (b *BootContext) SetPid(ctx context.Context, call api.BootContext_setPid) error
func (*BootContext) WithArgs ¶
func (b *BootContext) WithArgs(args ...string) *BootContext
func (*BootContext) WithCaps ¶
func (b *BootContext) WithCaps(caps ...capnp.Client) (*BootContext, error)
func (*BootContext) WithCid ¶
func (b *BootContext) WithCid(cid cid.Cid) *BootContext
func (*BootContext) WithPid ¶
func (b *BootContext) WithPid(pid uint32) *BootContext
func (*BootContext) WithRawArgs ¶
func (b *BootContext) WithRawArgs(args capnp.TextList) *BootContext
func (*BootContext) WithRawCaps ¶
func (b *BootContext) WithRawCaps(caps capnp.PointerList) *BootContext
type ByteCode ¶
type ByteCode []byte
ByteCode is a representation of arbitrary executable data.
type Cache ¶
type Cache api.BytecodeCache
type Executor ¶
Executor is a capability that can spawn processes.
func (Executor) Exec ¶
func (ex Executor) Exec(ctx context.Context, bc []byte, ppid uint32, bCtx api.BootContext) (Proc, capnp.ReleaseFunc)
Exec spawns a new process from WASM bytecode bc. If the caller is a WASM process spawned in this same executor, it should use its PID as ppid to mark the new process as a subprocess.
func (Executor) ExecFromCache ¶
func (ex Executor) ExecFromCache(ctx context.Context, cid cid.Cid, ppid uint32, bCtx api.BootContext) (Proc, capnp.ReleaseFunc)
ExecFromCache behaves the same way as Exec, but expects the bytecode to be already cached at the executor.
Click to show internal directories.
Click to hide internal directories.