Module

Examples.Workers.FibonacciWorker

Package
purescript-yoga-om-workerbees
Repository
rowtype-yoga/purescript-yoga-om-workerbees

#FibInput Source

type FibInput = { n :: Int }

Input type for the worker

#FibOutput Source

type FibOutput = { result :: Int, thread :: Int }

Output type for the worker

#fibonacci Source

fibonacci :: Int -> Int

CPU-intensive Fibonacci calculation (intentionally inefficient for demo)

#worker Source

worker :: WorkerContext Unit FibInput FibOutput -> Effect Unit

Worker main function This receives inputs and sends back outputs

#main Source

main :: Effect Unit

Entry point for the worker This must be the main function when bundled