Module cre_master

A module implementing the behavior of the common runtime environment (CRE).

Copyright © 2015-2018 Jörgen Brandt

Version: 0.1.4

Authors: Jörgen Brandt (joergen.brandt@onlinehome.de).

Description

A module implementing the behavior of the common runtime environment (CRE).

Function Index

add_worker/2Registers a worker process with a given CRE instance.
code_change/3
cre_request/4Requests the computation of an application from a given CRE intance.
handle_call/3
handle_cast/2
handle_info/2
init/1
start_link/0Starts an anonymous CRE instance.
start_link/1Starts a named CRE instance.
stop/1Stops the CRE instance.
terminate/2
worker_result/4Sends the result of a previously computed application to the CRE.

Function Details

add_worker/2

add_worker(CreName, WorkerName) -> any()

Registers a worker process with a given CRE instance.

Takes the name of a CRE instance CreName and the name of a worker instance WorkerName and adds the worker to the worker pool of the CRE. The presence of workers is a precondition for the CRE to send out demand or perform work. A CRE without workers, thus, can accept clients but can never make progress.

code_change/3

code_change(OldVsn, CreState, Extra) -> any()

cre_request/4

cre_request(CreName, ClientName, I, A) -> any()

Requests the computation of an application from a given CRE intance.

When a client with the name ClientName that has received demand has generated an application A belonging to a program with the program identifier I it uses this function to send the application to the CRE instance with the name CreName.

handle_call/3

handle_call(Request, From, CreState) -> any()

handle_cast/2

handle_cast(Request, CreState) -> any()

handle_info/2

handle_info(Info, CreState) -> any()

init/1

init(Arg) -> any()

start_link/0

start_link() -> any()

Starts an anonymous CRE instance.

Returns {ok, Pid} on success where Pid is the process id of the newly created process.

See also: start_link/1.

start_link/1

start_link(CreName) -> any()

Starts a named CRE instance.

Returns {ok, Pid} on success where Pid is the process id of the newly created process.

See also: start_link/0.

stop/1

stop(CreName) -> any()

Stops the CRE instance.

terminate/2

terminate(Reason, CreState) -> any()

worker_result/4

worker_result(CreName, WorkerName, A, Delta) -> any()

Sends the result of a previously computed application to the CRE.

When a worker has computed the result of an application that has previously been requested from it the worker sends the result back to the CRE using this function.


Generated by EDoc