FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kStatus kSystem_AddLocalNode ( kSystem  system,
k32u  nodeId,
kHealth  health,
const kChar storagePath 
)

Adds a host-local data processing node to the system.

This function creates a local node that can be used for host-based data coprocessing. The local node has a pipe but does not advertise itself on the network. Data can be routed from a remote node to the local node in order to distribute processing between the remote node and the local host.

Local nodes are created within the same operating system process as the caller (unlike virtual nodes, which exist as separate processes). Accordingly, the cost of serializing data for transmission across the network is incurred only once, as data travels from the remote node to the local host process.

A local node is represented by a kNode object. After calling kSystem_AddLocalNode to create the node, call kSystem_Refresh and then kSystem_FindNode to get the node handle. The node handle can be used to configure and control the local node.

Local nodes contain pipe modules that can be used in the normal way. In order to use all of the blocks avaiable on the remote node, local assemblies containing those blocks must be loaded on the host.

Local nodes contain storage modules, but storage support is optional. If the storagePath argument is provided, storage is implemented at the given location. Otherwise, storage operations will fail.

Local nodes support network data input to receive data from remote nodes. Data output is limited to deliving data to the local application (via kSystem). Local nodes also support health services. Each local node implements an independent health service, enabling the delivery of node-specific health and code profling statistics to the local application. Local nodes do not support messsage logging via control or health channels; kLog output from local nodes is delivered via the kApi log handler instead (kApiLib_SetLogfHandler).

Parameters
systemkSystem object.
nodeIdLocal node id (see kNodeId for information on composing node ids).
healthHealth service to use for local node (or kNULL to use dedicated health service).
storagePathOptional storage path.
Returns
Operation status.
See also
kNodeId, kSystem_RemoveLocalNode