# Control.Monad.Eff.AVar

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

### #makeEmptyVar Source

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

Creates a fresh AVar.

### #putVar Source

`putVar :: forall a eff. 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 a eff. 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 a eff. 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 a eff. 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 a eff. AVar a -> AVarEff eff (AVarStatus a)`

Synchronously checks the status of an AVar.

### #isEmptyVar Source

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

Synchronously checks whether an AVar currently is empty.

### #isFilledVar Source

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

Synchronously checks whether an AVar currently has a value.

### #isKilledVar Source

`isKilledVar :: forall a eff. 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