Module lasp_core

Data Types

actor()

actor() = term()

args()

args() = list()

crdt()

crdt() = type:crdt()

func()

func() = atom()

id()

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

metadata()

metadata() = orddict:orddict()

not_found()

not_found() = {error, not_found}

operation()

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

pending_threshold()

pending_threshold() = {threshold, read | wait, pid(), type(), threshold()}

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/3Define a dataflow variable to be bound a value.
bind/4
bind_to/3Define a dataflow variable to be bound to another dataflow variable.
bind_to/4Define a dataflow variable to be bound to another dataflow variable.
bind_to/5
bind_var/3
declare/1Declare a dataflow variable in a provided by identifer.
declare/2Declare a dataflow variable, as a given type.
declare/3Declare a dataflow variable in a provided by identifer.
declare/4Declare a dataflow variable in a provided by identifer.
declare/5Declare a dataflow variable in a provided by identifer.
declare_dynamic/4Declare a dynamic variable in a provided by identifer.
filter/4Filter values from one lattice into another.
filter/6Filter values from one lattice into another.
fold/4Fold values from one lattice into another.
fold/6Fold values from one lattice into another.
intersection/4Compute the intersection of two sets.
intersection/7Compute the intersection of two sets.
map/4Map values from one lattice into another.
map/6Map values from one lattice into another.
product/4Compute the cartesian product of two sets.
product/7Compute the cartesian product of two sets.
query/2Return the current value of a CRDT.
read/2Perform a read for a particular identifier.
read/3Perform a monotonic read read for a particular identifier.
read/6Perform a read (or monotonic read) for a particular identifier.
read_any/2Perform a monotonic read for a series of given idenfitiers -- first response wins.
read_var/3
receive_delta/2When the delta interval is arrived, bind it with the existing object.
receive_value/2
reply_to_all/2Given a group of processes which are blocking on reads, notify them of bound values or met thresholds.
reply_to_all/3Given a group of processes which are blocking on reads, notify them of bound values or met thresholds.
stream/3Stream values out of the Lasp system; using the values from this stream can result in observable nondeterminism.
thread/4Spawn a function.
union/4Compute the union of two sets.
union/7Compute the union of two sets.
update/4Update a dataflow variable given an operation.
update/6
update_metadata/5Update metadata.
wait_needed/2Pause execution until value requested with given threshold.
wait_needed/3Pause execution until value requested with given threshold.
wait_needed/6Callback wait_needed function for lasp_vnode, where we change the reply and blocking replies.

Function Details

bind/3

bind(Id::id(), Value::value(), Store::store()) -> {ok, var()} | not_found()

Define a dataflow variable to be bound a value.

bind/4

bind(Id, Value, MetadataFun, Store) -> any()

bind_to/3

bind_to(AccId::id(), Id::id(), Store::store()) -> {ok, pid()}

Define a dataflow variable to be bound to another dataflow variable.

bind_to/4

bind_to(AccId::id(), Id::id(), Store::store(), BindFun::function()) -> {ok, pid()}

Define a dataflow variable to be bound to another dataflow variable.

This version, performs a partial bind to another dataflow variable.

FetchFun is used to specify how to find the target identifier, given it is located in another data store.

FromPid is sent a message with the target identifiers value, if the target identifier is already bound.

bind_to/5

bind_to(AccId, Id, Store, BindFun, ReadFun) -> any()

bind_var/3

bind_var(Id, Value, Store) -> any()

declare/1

declare(Store::store()) -> {ok, var()}

Declare a dataflow variable in a provided by identifer.

declare/2

declare(Type::type(), Store::store()) -> {ok, var()}

Declare a dataflow variable, as a given type.

declare/3

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

Declare a dataflow variable in a provided by identifer.

declare/4

declare(Id::id(), Type::type(), MetadataFun::function(), Store::store()) -> {ok, var()}

Declare a dataflow variable in a provided by identifer.

declare/5

declare(Id::id(), Type::type(), MetadataFun::function(), MetadataNew::any(), Store::store()) -> {ok, var()}

Declare a dataflow variable in a provided by identifer.

declare_dynamic/4

declare_dynamic(Id::id(), Type::type(), MetadataFun0::function(), Store::store()) -> {ok, var()}

Declare a dynamic variable in a provided by identifer.

filter/4

filter(Id::id(), Function::function(), AccId::id(), Store::store()) -> {ok, pid()}

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.

filter/6

filter(Id::id(), Function::function(), AccId::id(), Store::store(), BindFun::function(), ReadFun::function()) -> {ok, pid()}

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.

Similar to filter/4, however, provides an override function for the BindFun, which is responsible for binding the result, for instance, when it's located in another table.

fold/4

fold(Id::id(), Function::function(), AccId::id(), Store::store()) -> {ok, pid()}

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.

fold/6

fold(Id::id(), Function::function(), AccId::id(), Store::store(), BindFun::function(), ReadFun::function()) -> {ok, pid()}

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.

Similar to fold/4, however, provides an override function for the BindFun, which is responsible for binding the result, for instance, when it's located in another table.

intersection/4

intersection(Left::id(), Right::id(), Intersection::id(), Store::store()) -> {ok, pid()}

Compute the intersection of two sets.

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

intersection/7

intersection(Left::id(), Right::id(), AccId::id(), Store::store(), BindFun::function(), ReadLeftFun::function(), ReadRightFun::function()) -> {ok, pid()}

Compute the intersection of two sets.

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

Similar to intersection/4, however, provides an override function for the BindFun, which is responsible for binding the result, for instance, when it's located in another table.

map/4

map(Id::id(), Function::function(), AccId::id(), Store::store()) -> {ok, pid()}

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.

map/6

map(Id::id(), Function::function(), AccId::id(), Store::store(), BindFun::function(), ReadFun::function()) -> {ok, pid()}

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.

Similar to map/4, however, provides an override function for the BindFun, which is responsible for binding the result, for instance, when it's located in another table.

product/4

product(Left::id(), Right::id(), Product::id(), Store::store()) -> {ok, pid()}

Compute the cartesian product of two sets.

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

product/7

product(Left::id(), Right::id(), AccId::id(), Store::store(), BindFun::function(), ReadLeftFun::function(), ReadRightFun::function()) -> {ok, pid()}

Compute the cartesian product of two sets.

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

Similar to product/4, however, provides an override function for the BindFun, which is responsible for binding the result, for instance, when it's located in another table.

query/2

query(Id::id(), Store::store()) -> {ok, term()}

Return the current value of a CRDT.

Same as query_var, but tracked in the dag.

read/2

read(Id::id(), Store::store()) -> {ok, var()}

Perform a read for a particular identifier.

Given an Id, perform a blocking read until the variable is bound.

read/3

read(Id::id(), Threshold::value(), Store::store()) -> {ok, var()}

Perform a monotonic read read for a particular identifier.

Given an Id, perform a blocking read until the variable is bound.

This operation blocks until Threshold has been reached. As read/6 runs inside a lasp process, we have to block outside, or else it may get killed when used in combination with other lasp processes (for example, when used as the read function of another lasp process).

read/6

read(Id::id(), Threshold::value(), Store::store(), Self::pid(), ReplyFun::function(), BlockingFun::function()) -> {ok, var()} | not_found() | block

Perform a read (or monotonic read) for a particular identifier.

Same as read_var, but tracked in the dag.

read_any/2

read_any(Reads::[{id(), value()}], Store::store()) -> {ok, var()}

Perform a monotonic read for a series of given idenfitiers -- first response wins.

read_var/3

read_var(Id, Threshold, Store) -> any()

receive_delta/2

receive_delta(Store::store(), X2::{delta_send, node(), value(), function(), function()} | {delta_ack, id(), node(), non_neg_integer()}) -> ok | error

When the delta interval is arrived, bind it with the existing object. If the object does not exist, declare it.

receive_value/2

receive_value(Store::store(), X2::{state_send, node(), value(), function(), function()}) -> {ok, crdt()}

reply_to_all/2

reply_to_all(List::[pid() | pending_threshold()], Result::term()) -> {ok, [pending_threshold()]}

Given a group of processes which are blocking on reads, notify them of bound values or met thresholds.

reply_to_all/3

reply_to_all(T::[pid() | pending_threshold()], StillWaiting0::[pending_threshold()], Result::term()) -> {ok, [pending_threshold()]}

Given a group of processes which are blocking on reads, notify them of bound values or met thresholds.

stream/3

stream(Id, Function, Store) -> any()

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

thread/4

thread(Module::module(), Function::func(), Args::args(), Store::store()) -> ok

Spawn a function.

Spawn a process executing Module:Function(Args).

union/4

union(Left::id(), Right::id(), Union::id(), Store::store()) -> {ok, pid()}

Compute the union of two sets.

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

union/7

union(Left::id(), Right::id(), AccId::id(), Store::store(), BindFun::function(), ReadLeftFun::function(), ReadRightFun::function()) -> {ok, pid()}

Compute the union of two sets.

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

Similar to union/4, however, provides an override function for the BindFun, which is responsible for binding the result, for instance, when it's located in another table.

update/4

update(Id::id(), Operation::operation(), Actor::actor(), Store::store()) -> {ok, var()} | not_found()

Update a dataflow variable given an operation.

Similar to update/5.

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.

update/6

update(Id::id(), Operation::operation(), Actor::actor(), MetadataFun::function(), MetadataFunDeclare::function(), Store::store()) -> {ok, var()} | not_found()

update_metadata/5

update_metadata(Id, Actor, MetadataFun, MetadataFunDeclare, Store) -> any()

Update metadata.

wait_needed/2

wait_needed(Id::id(), Store::store()) -> {ok, threshold()}

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.

wait_needed/3

wait_needed(Id::id(), Threshold::threshold(), Store::store()) -> {ok, threshold()}

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.

This operation blocks until Threshold has been requested.

wait_needed/6

wait_needed(Id::id(), Threshold::threshold(), Store::store(), Self::pid(), ReplyFun::function(), BlockingFun::function()) -> {ok, threshold()}

Callback wait_needed function for lasp_vnode, where we change the reply and blocking replies.

Similar to wait_needed/2.

BlockingFun is used to override the handling of waiting for a read operation to trigger on something that is waiting (lazy).

ReplyFun is used to override the function which is used to notify waiting processes, for instance, if they are running on another node.

This operation blocks until Threshold has been requested.


Generated by EDoc