Module

Aff.Workers.Service

Package
purescript-workers
Repository
truqu/purescript-workers

#controller Source

controller :: forall e. Aff (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 -> Aff (worker :: WORKER | e) Unit

#onMessage Source

onMessage :: forall msg e' e. (msg -> Eff e' Unit) -> Aff (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. Aff (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) -> Aff (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 -> Aff (worker :: WORKER | e) Unit

Re-exports from Aff.Workers

#WorkerType Source

#WORKER Source

data WORKER :: Effect

#postMessage' Source

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

Clones message and transmits it to the port object associated with dedicatedportGlobal.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 -> Aff (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) -> Aff (worker :: WORKER | e) Unit

Event handler for the error event.

Re-exports from Workers.Service

#RegistrationOptions Source

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

#Registration Source