HadesLang Doc
Search…
Overview
Getting Started
Language Spec
Foundation
Operators
Control flow
Classes and variables
Actors
Message passing
GenServer
Channels
Functions and lambdas
Functions of simple types
Other
Core Libraries
Other
Powered By
GitBook
Actors
Hades implements the Actor model in a very lightweight way. Every process in Hades has a state and a message queue. In Hades, one can pass messages from process to process. Processes are referenced via PIDs.
More on the actor model
here
.
One can create a new actor with the built-in
spawn
function.
Example
with console from std
:
io
with
WaitGroup
from std
:
sync
​
var
wg
=
WaitGroup
()
​
spawn
({
_
=>
wg
.
add
()
for
(
_
in
0
|..|
11
)
console
.
out
(
"Hello from the actor!"
)
end
wg
.
done
()
})
​
wg
.
wait
()
Previous
Type conversions in simple variable types
Next
Message passing
Last modified
2yr ago
Copy link