Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecScript ¶
ExecScript runs a Starlark script that must define a top-level `main(w)` function, then calls `main` passing a `w` module and returns the value produced by `main` (which is `starlark.None` when `main` has no explicit return).
Types ¶
type Backend ¶
type Backend interface {
Print(msg string)
Now() time.Time
Load(ctx context.Context, thread *starlark.Thread, module string) (starlark.StringDict, error)
Select(ctx context.Context, cases *starlark.Dict, defaultCase starlark.Value, timeout time.Duration, timeoutValue starlark.Value) (starlark.Value, error)
Signal(ctx context.Context, workflowID, signalName, payloadJSON, runID string) (bool, error)
ReceiveChannel(channelName string) (Future, error)
Sleep(ctx context.Context, duration time.Duration) error
Timer(duration time.Duration) Future
WorkflowID() string
// Gather waits for all given futures. If returnList is false it returns the
// single future's value; otherwise it returns a starlark.List of values.
// If timeout is non-zero and elapses before all futures are ready, it returns
// timeoutValue instead of a result.
Gather(ctx context.Context, futures []Future, timeout time.Duration, timeoutValue starlark.Value, returnList bool) (starlark.Value, error)
// Run schedules a built-in activity identified by uri and returns a Future
// whose Get() yields the activity's decoded output value. args are the
// remaining positional arguments in stringified form; their meaning is
// uri-specific and opaque to the engine.
Run(uri string, args []string) (Future, error)
}
Backend is the interface of AutoFlow backend implementation.
type ExecScriptOptions ¶
type FutureType ¶
type FutureType struct {
// contains filtered or unexported fields
}
func NewFutureType ¶
func NewFutureType(f Future) *FutureType
NewFutureType wraps a Future as a starlark Value.
func (*FutureType) Freeze ¶
func (f *FutureType) Freeze()
func (*FutureType) Hash ¶
func (f *FutureType) Hash() (uint32, error)
func (*FutureType) Name ¶
func (f *FutureType) Name() string
func (*FutureType) String ¶
func (f *FutureType) String() string
func (*FutureType) Truth ¶
func (f *FutureType) Truth() starlark.Bool
func (*FutureType) Type ¶
func (f *FutureType) Type() string
func (*FutureType) Unwrap ¶
func (f *FutureType) Unwrap() any
Click to show internal directories.
Click to hide internal directories.