method NodeBackground.spawnDaemon
Like spawn, but the task never keeps the node alive: it is cancelled when main returns (runtime helpers such as the server of
a dynamic config, D-5197).
Example:
fn main() io, time {
node.background.spawnDaemon(() => {
sleep(60s)
})
print("main returns; the daemon does not keep the node alive")
}Вывод
main returns; the daemon does not keep the node alive
pub(api) fn spawnDaemon<effect F>(f: fn() F)С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
f | fn() F |
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/node.oxl:55