Module

Workers.Service

Package
purescript-workers
Repository
truqu/purescript-workers

#Registration Source

#RegistrationOptions Source

type RegistrationOptions = { scope :: String, workerType :: WorkerType }

#controller Source

controller :: forall e. Eff (worker :: WORKER | e) (Maybe Service)

#getRegistration Source

getRegistration :: forall e. Maybe String -> Aff (worker :: WORKER | e) (Maybe Registration)

#onControllerChange Source

onControllerChange :: forall e' e. Eff e' Unit -> Eff (worker :: WORKER | e) Unit

#onMessage Source

onMessage :: forall msg e' e. (msg -> Eff e' Unit) -> Eff (worker :: WORKER | e) Unit

#ready Source

ready :: forall e. Aff (worker :: WORKER | e) Registration

#register Source

register :: forall e. String -> Aff (worker :: WORKER | e) Registration

#register' Source

register' :: forall e. String -> RegistrationOptions -> Aff (worker :: WORKER | e) Registration

#startMessages Source

startMessages :: forall e. Eff (worker :: WORKER | e) Unit

#wait Source

wait :: forall e. Aff (worker :: WORKER | e) Service

#onStateChange Source

onStateChange :: forall e' e. Service -> (State -> Eff e' Unit) -> Eff (worker :: WORKER | e) Unit

#update Source

update :: forall e. Registration -> Aff (worker :: WORKER | e) Unit

#unregister Source

unregister :: forall e. Registration -> Aff (worker :: WORKER | e) Boolean

#onUpdateFound Source

onUpdateFound :: forall e' e. Registration -> Eff e' Unit -> Eff (worker :: WORKER | e) Unit

Re-exports from Workers

#WorkerType Source

#WORKER Source

data WORKER :: Effect

#postMessage' Source

postMessage' :: forall channel transfer msg e. Channel channel => channel -> msg -> Array transfer -> Eff (exception :: EXCEPTION, worker :: WORKER | e) Unit

Clones message and transmits it to the port object associated with dedicatedWorker-Global.transfer can be passed as a list of objects that are to be transferred rather than cloned.

#postMessage Source

postMessage :: forall channel msg e. Channel channel => channel -> msg -> Eff (exception :: EXCEPTION, worker :: WORKER | e) Unit

Clones message and transmits it to the Worker object.

#onError Source

onError :: forall worker e' e. AbstractWorker worker => worker -> (Error -> Eff e' Unit) -> Eff (worker :: WORKER | e) Unit

Event handler for the error event.