Module
Yoga.Om.WorkerBees.SharedState
- Package
- purescript-yoga-om-workerbees
- Repository
- rowtype-yoga/purescript-yoga-om-workerbees
#new Source
new :: forall a. WriteForeign a => Int -> a -> Effect (SharedState a)Create a new SharedState with an initial value.
maxBytes is the maximum size for the serialized JSON data.
#read Source
read :: forall a. ReadForeign a => SharedState a -> Effect aAtomically read the current state.
#write Source
write :: forall a. WriteForeign a => SharedState a -> a -> Effect UnitAtomically write a new state value.
#modify Source
modify :: forall a. ReadForeign a => WriteForeign a => SharedState a -> (a -> a) -> Effect aAtomically modify the state. Returns the new value.
#toSendable Source
toSendable :: forall a. SharedState a -> SendWrapper (SharedState a)Wrap for worker transfer. The underlying SharedArrayBuffer is shared.
#fromSendable Source
fromSendable :: forall a. SendWrapper (SharedState a) -> Effect (SharedState a)Unwrap on the worker side. Reconstructs Int32Array views from the shared buffer.
- Modules
- Examples.
FibonacciDemo - Examples.
SharedCounterDemo - Examples.
SharedMapDemo - Examples.
SharedStateDemo - Examples.
Workers. CounterWorker - Examples.
Workers. FibonacciWorker - Examples.
Workers. HashWorker - Yoga.
Om. WorkerBees - Yoga.
Om. WorkerBees. Atomics - Yoga.
Om. WorkerBees. SharedArrayBuffer - Yoga.
Om. WorkerBees. SharedInt - Yoga.
Om. WorkerBees. SharedMap - Yoga.
Om. WorkerBees. SharedState