Module

Examples.Workers.HashWorker

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

#HashInput Source

type HashInput = { iterations :: Int, text :: String }

Input type for the worker

#HashOutput Source

type HashOutput = { hash :: String, length :: Int }

Output type for the worker

#simpleHash Source

simpleHash :: String -> Int

Simple hash function (for demonstration - not cryptographically secure!)

#computeHash Source

computeHash :: String -> Int -> String

CPU-intensive hash calculation with multiple iterations

#worker Source

worker :: WorkerContext Unit HashInput HashOutput -> Effect Unit

Worker main function This receives inputs and sends back outputs

#main Source

main :: Effect Unit

Entry point for the worker