Module lasp_distribution_backend

Behaviours: gen_server.

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()

store()

store() = ets:tid() | atom() | reference() | pid()

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_to/2Bind a dataflow variable to another dataflow variable.
declare/2Declare a new dataflow variable of a given type.
declare_dynamic/2Declare a new dynamic variable of a given type.
disinterested/1
enforce_once/3Enforce a invariant once over a monotonic condition.
filter/3Filter values from one lattice into another.
fold/3Fold values from one lattice into another.
handle_cast/2
interested/1
intersection/3Compute the intersection of two sets.
map/3Map values from one lattice into another.
product/3Compute the cartesian product of two sets.
propagate/1
query/1Read 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 all Lasp application state.
set_topic/2
start_link/0Same as start_link([]).
start_link/1Start and link to calling process.
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(), Value0::value()) -> {ok, var()}

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_to/2

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

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/2

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

Declare a new dataflow variable of a given type.

declare_dynamic/2

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

Declare a new dynamic variable of a given type.

disinterested/1

disinterested(Topic) -> any()

enforce_once/3

enforce_once(Id::id(), Threshold::threshold(), EnforceFun::function()) -> ok

Enforce a invariant once over a monotonic condition.

filter/3

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

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()

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.

handle_cast/2

handle_cast(Msg::term(), State::#state{store = store(), gossip_peers = [], actor = binary()}) -> {noreply, #state{store = store(), gossip_peers = [], actor = binary()}}

interested/1

interested(Topic) -> any()

intersection/3

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

Compute the intersection of two sets.

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

map/3

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

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()

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::id()) -> ok

query/1

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

Read the current value of a CRDT.

Given a Id, read the current value, compute the query operation for the value, and return it to the user.

read/2

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

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()

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

remove_topic/2

remove_topic(Id, Topic) -> any()

reset/0

reset() -> ok

Reset all Lasp application state.

set_topic/2

set_topic(Id, Topic) -> any()

start_link/0

start_link() -> {ok, pid()} | ignore | {error, term()}

Same as start_link([]).

start_link/1

start_link(Opts::list()) -> {ok, pid()} | ignore | {error, term()}

Start and link to calling process.

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()

Spawn a function.

Spawn a process executing Module:Function(Args).

union/3

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

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()

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()

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