Module ce_rec

Remote Execution Contexts (rec).

Description

Remote Execution Contexts (rec).

'Remote Execution Context' is basically a fancy way of saying 'workaround for rpc'.

Some operations, such as file:open/2, return an object which is owned by the process that created it. When the parent process dies, that object is expunged.

rpc:call/4 is not useful for such an operation, because it executes the given function with a short-lived process.

A viable workaround is to instead use ce_rec:start/1 to create a long-lived process ('execution context') on a remote node, ce_rec:rpc/2 to execute such an operation in that context, and finally ce_rec:stop/1 when the objects owned by the remote execution context are no longer needed.

Function Index

rpc/2Equivalent to rpc(Pid, Fun, 10000).
rpc/3Executes a fun/0 in a given remote execution context.
start/1Starts an execution context on the given node.
stop/1Shuts down the given execution context.

Function Details

rpc/2

rpc(Pid::pid(), Fun::'fun'()) -> term()

Equivalent to rpc(Pid, Fun, 10000).

rpc/3

rpc(Pid::pid(), Fun::'fun'(), Timeout::integer()) -> term()

Executes a fun/0 in a given remote execution context. Returns the result of the fun. May exit with timeout if the call lasts more than Timeout milliseconds.

start/1

start(Node::node()) -> rec()

Starts an execution context on the given node.

stop/1

stop(Pid::rec()) -> ok | {error, Reason}

Shuts down the given execution context.


Generated by EDoc, Dec 25 2007, 02:37:45.