Libraries
bignum
binary
bitmap
ble
bytes
core
collections
comparable
entry
exceptions
finalization
numbers
objects
print
process
string
task
time
timer
utils
crypto
device
encoding
esp32
expect
fixed-point
flash
font
gpio
i2c
i2s
icons
io
line-wrap
log
math
monitor
net
pulse-counter
reader
reader-writer
rmt
serial
spi
statistics
system
tls
uart
uuid
writer
zlib
Library task
This is exported from the core library, which means you don't need to import it.
Interfaces
Task
A task.
Functions
task
->
Task
Returns the object for the current task.
Deprecated: Use
Task.current
instead.
task
code/
Lambda
--name/
string
=
"User task"
--background/
bool
=
null
->
Task
Creates a new user task.
Calls
code
in a new task.
If the
background
flag is set, then the new task will not block termination. The
background
task flag is passed on to sub-tasks.
yield
->
none
Voluntarily yields control of the CPU to other tasks.
Advanced
The Toit programming language is cooperatively scheduled, so it is important to place yields in long running loops if other tasks should get an opportunity to run.