Module lasp

Data Types

actor()

actor() = term()

args()

args() = list()

error()

error() = {error, atom()}

func()

func() = atom()

id()

id() = binary() | {binary(), type()}

metadata()

metadata() = orddict:orddict()

operation()

operation() = {atom(), value()} | {atom(), value(), value()} | atom()

threshold()

threshold() = value() | {strict, value()}

type()

type() = term()

value()

value() = term()

var()

var() = {id(), type(), metadata(), value()}

Function Index

bind/2Bind a dataflow variable to a value.
bind/4Bind a dataflow variable to the result of a function call.
bind_to/2Bind a dataflow variable to another dataflow variable.
declare/1Declare a new dataflow variable of a given type.
declare/2Declare a new dataflow variable of a given type.
declare_dynamic/1Declare a new dynamic variable of a given type.
declare_dynamic/2Declare a new dynamic variable of a given type and identifier.
disinterested/1
enforce_once/3Enforce an invariant once, by selecting the lowest node in the membership list.
filter/3Filter values from one lattice into another.
fold/3Fold values from one lattice into another.
interested/1
intersection/3Compute the intersection of two sets.
invariant/3Invariant enforcing function; once a particular threhsold for an object is met, then invoke the enforce function.
map/3Map values from one lattice into another.
product/3Compute the cartesian product of two sets.
propagate/1Propagate values by identifier.
query/1Return the current value of a CRDT.
read/2Blocking monotonic read operation for a given dataflow variable.
read_any/1Blocking monotonic read operation for a list of given dataflow variables.
remove_topic/2
reset/0Reset state.
set_topic/2
stream/2Stream values out of the Lasp system; using the values from this stream can result in observable nondeterminism.
thread/3Spawn a function.
union/3Compute the union of two sets.
update/3Update a dataflow variable.
wait_needed/2Pause execution until value requested with given threshold.

Function Details

bind/2

bind(Id::id(), Value::value()) -> {ok, var()} | {error, timeout}

Bind a dataflow variable to a value.

The provided Id is identifier of a previously declared (see: declare/0) dataflow variable. The Value provided is the value to bind.

bind/4

bind(Id::id(), Module::module(), Function::func(), Args::args()) -> {ok, var()} | {error, timeout}

Bind a dataflow variable to the result of a function call.

Execute Module:Function(Args) and bind the result using bind/2.

bind_to/2

bind_to(Id::id(), TheirId::id()) -> {ok, id()} | {error, timeout}

Bind a dataflow variable to another dataflow variable.

The provided Id is identifier of a previously declared (see: declare/0) dataflow variable. The Value provided is the value to bind.

declare/1

declare(Type::type()) -> {ok, var()} | {error, timeout}

Declare a new dataflow variable of a given type.

declare/2

declare(Id::id(), Type::type()) -> {ok, var()} | {error, timeout}

Declare a new dataflow variable of a given type.

declare_dynamic/1

declare_dynamic(Type::type()) -> {ok, var()} | {error, timeout}

Declare a new dynamic variable of a given type.

declare_dynamic/2

declare_dynamic(Id::id(), Type::type()) -> {ok, var()} | {error, timeout}

Declare a new dynamic variable of a given type and identifier.

disinterested/1

disinterested(Topic) -> any()

enforce_once/3

enforce_once(Id, Threshold, EnforceFun) -> any()

Enforce an invariant once, by selecting the lowest node in the membership list.

filter/3

filter(Id::id(), Function::function(), AccId::id()) -> ok | {error, timeout}

Filter values from one lattice into another.

Applies the given Function as a filter over the items in Id, placing the result in AccId, both of which need to be declared variables.

fold/3

fold(Id::id(), Function::function(), AccId::id()) -> ok | {error, timeout}

Fold values from one lattice into another.

Applies the given Function as a fold over the items in Id, placing the result in AccId, both of which need to be declared variables.

interested/1

interested(Topic) -> any()

intersection/3

intersection(Left::id(), Right::id(), Intersection::id()) -> ok | {error, timeout}

Compute the intersection of two sets.

Computes the intersection of two sets and bind the result to a third.

invariant/3

invariant(Id, Threshold, EnforceFun) -> any()

Invariant enforcing function; once a particular threhsold for an object is met, then invoke the enforce function.

map/3

map(Id::id(), Function::function(), AccId::id()) -> ok | {error, timeout}

Map values from one lattice into another.

Applies the given Function as a map over the items in Id, placing the result in AccId, both of which need to be declared variables.

product/3

product(Left::id(), Right::id(), Product::id()) -> ok | {error, timeout}

Compute the cartesian product of two sets.

Computes the cartestian product of two sets and bind the result to a third.

propagate/1

propagate(Id) -> any()

Propagate values by identifier.

query/1

query(Id::id()) -> {ok, term()} | error()

Return the current value of a CRDT.

For a given Id, compute the current value of a CRDT and return it.

read/2

read(Id::id(), Threshold::threshold()) -> {ok, var()} | {error, timeout}

Blocking monotonic read operation for a given dataflow variable.

Block until the variable identified by Id has been bound, and is monotonically greater (as defined by the lattice) then the provided Threshold value.

read_any/1

read_any(Reads::[{id(), threshold()}]) -> {ok, var()} | {error, timeout}

Blocking monotonic read operation for a list of given dataflow variables.

remove_topic/2

remove_topic(Id, Topic) -> any()

reset/0

reset() -> any()

Reset state.

set_topic/2

set_topic(Id, Topic) -> any()

stream/2

stream(Id, Function) -> any()

Stream values out of the Lasp system; using the values from this stream can result in observable nondeterminism.

thread/3

thread(Module::module(), Function::func(), Args::args()) -> ok | {error, timeout}

Spawn a function.

Spawn a process executing Module:Function(Args).

union/3

union(Left::id(), Right::id(), Union::id()) -> ok | {error, timeout}

Compute the union of two sets.

Computes the union of two sets and bind the result to a third.

update/3

update(Id::id(), Operation::operation(), Actor::actor()) -> {ok, var()} | {error, timeout}

Update a dataflow variable.

Read the given Id and update it given the provided Operation, which should be valid for the type of CRDT stored at the given Id.

wait_needed/2

wait_needed(Id::id(), Threshold::threshold()) -> ok | {error, timeout}

Pause execution until value requested with given threshold.

Pause execution of calling thread until a read operation is issued for the given Id. Used to introduce laziness into a computation.


Generated by EDoc