nanoworker

Types

pub type Worker(value) {
  Worker(value)
}

Constructors

  • Worker(value)

Functions

pub fn close(worker: Worker(a)) -> Nil

Close the worker and release its resources

pub fn create(handler: fn(a) -> b) -> Promise(Worker(b))

Create a new worker

pub fn send(worker: Worker(a), message: a) -> Promise(a)

Send a message to the worker

Search Document