Documentation
¶
Overview ¶
Package parallelmodule contains Starlark functions for running code in parallel. Unlike other Starlark modules in skycfg, this module is not loaded by skycfg by default.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = &starlarkstruct.Module{ Name: "parallel", Members: starlark.StringDict{ "map": starlark.NewBuiltin("parallel.map", parMap), }, }
NewModule returns a Starlark module of parallel functions.
parallel = module(
map,
)
def map(function, iterable):
Runs function on each element of iterable in parallel. Returns a list containing the result of function, in the same order as the original iterable. If any call to function fails, parallel.map fails as well. If multiple invocations fail, the error is chosen arbitrarily.
To guarantee safety, the following measures are taken:
- The function and each element of iterable are frozen.
- map cannot be called during module initialization. See https://github.com/google/starlark-go/issues/623.
- map detects and forbids recursion, even if Starlark is configured to allow recursion.
Functions ¶
Types ¶
type ThreadCreator ¶
func GetThreadCreator ¶
func GetThreadCreator(t *starlark.Thread) ThreadCreator
Click to show internal directories.
Click to hide internal directories.