Using gleam, cannot import 'gleam/otp/process'

52 views Asked by At

Using Gleam, what is best practice for spawning a process:

import gleam/io
import gleam/http
import gleam/http/response
import gleam/http/request
import gleam/int
import gleam/otp/process  // <<<< this does not exist?


pub fn handle_request(_req: request) -> response {
  process.spawn(fn() { io.println(int.to_string(5)) })
  response.ok("Processed request in a new process")
}

pub fn main() {
  let settings = http.default_settings()
  http.start(settings, handle_request)
}

the problem is import gleam/otp/process is not a thing - how to import that? I get a compile error with this import.

0

There are 0 answers