# Control.Monad.Eff.AVar

- Package
- purescript-avar
- Repository
- slamdata/purescript-avar

### #makeEmptyVar Source

`makeEmptyVar :: forall eff a. AVarEff eff (AVar a)`

Creates a fresh AVar.

### #putVar Source

`putVar :: forall eff a. a -> AVar a -> AVarCallback eff Unit -> AVarEff eff (AVarEff eff Unit)`

Sets the value of the AVar. If the AVar is already filled, it will be queued until the value is emptied. Multiple puts will resolve in order as the AVar becomes available. Returns an effect which will remove the callback from the pending queue.

### #takeVar Source

`takeVar :: forall eff a. AVar a -> AVarCallback eff a -> AVarEff eff (AVarEff eff Unit)`

Takes the AVar value, leaving it empty. If the AVar is already empty, the callback will be queued until the AVar is filled. Multiple takes will resolve in order as the AVar fills. Returns an effect which will remove the callback from the pending queue.

### #tryTakeVar Source

`tryTakeVar :: forall eff a. AVar a -> AVarEff eff (Maybe a)`

Attempts to synchronously take an AVar value, leaving it empty. If the
AVar is empty, this will return `Nothing`

.

### #tryReadVar Source

`tryReadVar :: forall eff a. AVar a -> AVarEff eff (Maybe a)`

Attempts to synchronously read an AVar. If the AVar is empty, this will
return `Nothing`

.

### #status Source

`status :: forall eff a. AVar a -> AVarEff eff (AVarStatus a)`

Synchronously checks the status of an AVar.

### #isEmptyVar Source

`isEmptyVar :: forall eff a. AVar a -> AVarEff eff Boolean`

Synchronously checks whether an AVar currently is empty.

### #isFilledVar Source

`isFilledVar :: forall eff a. AVar a -> AVarEff eff Boolean`

Synchronously checks whether an AVar currently has a value.

### #isKilledVar Source

`isKilledVar :: forall eff a. AVar a -> AVarEff eff Boolean`

Synchronously checks whether an AVar has been killed.

### #isEmpty Source

`isEmpty :: forall a. AVarStatus a -> Boolean`

### #isFilled Source

`isFilled :: forall a. AVarStatus a -> Boolean`

### #isKilled Source

`isKilled :: forall a. AVarStatus a -> Boolean`

- Modules
- Control.
Monad. Eff. AVar