LanguageExt.Core

LanguageExt.Core Concurrency Signals

Contents

class CountdownSignal <M> Source #

where M : Monad<M>

IO signalling, usually used to signal for cross-thread synchronisation.

Properties

property int Initial Source #

The initial value of the counter

property K<M, int> Count Source #

The current value of the counter

property K<M, bool> Complete Source #

True if the counter has complete its countdown

Methods

method K<M, bool> Trigger () Source #

Triggers a single countdown of the counter in the signal

Parameters

returns

True if the counter reached zero.

method bool TriggerUnsafe () Source #

Triggers a single countdown of the counter in the signal

Parameters

returns

True if the counter reached zero.

method K<M, bool> Trigger (int count) Source #

Triggers n signals to the counter in the signal

This is marked unsafe because it's not in an IO operation and therefore is impure.

Parameters

returns

True if the counter reached zero.

method bool TriggerUnsafe (int count) Source #

Triggers n signals to the counter in the signal

This is marked unsafe because it's not in an IO operation and therefore is impure.

Parameters

returns

True if the counter reached zero.

method K<M, Unit> Wait () Source #

Wait for signal to signal

Parameters

returns

Monad M with the Wait operation lifted into it via liftIO

method void Dispose () Source #

class Signal <M> Source #

where M : Monad<M>

IO signalling, usually used to signal for cross-thread synchronisation.

Methods

method K<M, bool> Trigger () Source #

Set the signal

Parameters

returns

True if the operation succeeds

method bool TriggerUnsafe () Source #

Set the signal

This is marked unsafe because it's not in an IO operation and therefore is impure.

Parameters

returns

True if the operation succeeds

method K<M, bool> Wait () Source #

Wait for signal to signal

Parameters

returns

method K<M, bool> Wait (TimeSpan timeout) Source #

Wait for signal to signal

Parameters

returns

method K<M, bool> Wait (int timeoutMilliseconds) Source #

Wait for signal to signal

Parameters

returns

method void Dispose () Source #

class Signal Source #

IO signalling constructors

Methods

method K<M, Signal<M>> autoReset <M> (bool signaled = false) Source #

where M : Monad<M>

Represents a thread synchronisation event that, when signaled, resets automatically after releasing a single waiting thread.

The internal EventWaitHandle is wrapped with a use operator so that its handle is tracked by the IO resource-management system and auto-cleaned up if not done manually with release or using bracket.

Parameters

param signaled

to set the initial state to signaled; to set the initial state to non-signaled.

method K<M, Signal<M>> manualReset <M> (bool signaled = false) Source #

where M : Monad<M>

Represents a thread synchronisation event that, when signaled, must be reset manually.

The internal EventWaitHandle is wrapped with a use operator so that its handle is tracked by the IO resource-management system and auto-cleaned up if not done manually with release or using bracket.

Parameters

param signaled

to set the initial state signaled; to set the initial state to non-signaled.

method K<M, CountdownSignal<M>> countdown <M> (int count) Source #

where M : Monad<M>

Represents a synchronisation primitive that is signaled when its count reaches zero.

The internal EventWaitHandle is wrapped with a use operator so that its handle is tracked by the IO resource-management system and auto-cleaned up if not done manually with release or using bracket.