Pudu programming language
Menu

Std.Concurrent.start

1 declaration

fn

start: fn() -> () -> Result[Std.Concurrent.Task, Std.Concurrent.ConcurrentError]

This is a callable function.

What it does

Start an action on a thread of its own.

The action is given the environment as it stands at the call, which is the

same environment an ordinary call would run in. Sharing it is safe because

every value in it is immutable: the things two threads can both change are

a channel, a lock, and a cell, and each of those is reached through

`Std.Channel` or `Std.Sync` rather than by writing to a variable.

A thread that failed does not take the program down. It reports what it

said to whoever joins it, which is the same rule every other operation

that reaches outside the program follows: the caller decides.

Read the signature

  • The text after the name is the type checked by Pudu.
  • Read arrows from left to right: inputs come first, and the final type is returned.
  • Names inside [ ] are type arguments, such as the item type held by a collection.
  • Result makes success and recoverable failure part of the function's type.

Back to Std.ConcurrentSearch related declarations