Module

Examples.SharedCounterDemo

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

#CounterInput Source

type CounterInput = { n :: Int }

Console demo of SharedInt (atomic counter) across worker threads

This demonstrates:

  • Creating a shared atomic counter
  • Passing shared memory to workers via workerData
  • Concurrent increments from multiple workers
  • Reading the final value

#CounterOutput Source

type CounterOutput = { count :: Int, result :: Int }