fwRPC
 All Files Functions Variables
fwRPC_worker.ctl File Reference

Functions

bool fwRPC_worker_isRunning ()
 
int fwRPC_worker_initialize (int &workerId)
 
private void _fwRPC_worker_dbg_report ()
 
int fwRPC_worker_stop () synchronized(_g_fwRPC_worker_activeRequests)
 
private void _fwRPC_worker_hdlState (anytype ctx, string project, string name, anytype msg)
 
private void _fwRPC_worker_hdlRequest (anytype ctx, string project, string name, anytype msg)
 
private void _fwRPC_worker_hdlCancel (anytype ctx, string project, string name, anytype msg)
 
private void _fwRPC_worker_startTick ()
 
private void _fwRPC_worker_processJobRequest (dyn_mixed request, dyn_mixed func) synchronized(_g_fwRPC_worker_this)
 
private int _fwRPC_worker_executeFunction (dyn_mixed request, dyn_mixed func)
 
private void _fwRPC_worker_executeFunction_run (string stubname, anytype ref, anytype params)
 
private void _fwRPC_worker_stopJob (anytype hdl, int status)
 
private void _fwRPC_worker_processJobCompletion (anytype hdl)
 
private void _fwRPC_worker_offsetJobCount (int offset) synchronized(_g_fwRPC_worker_this)
 
private synchronized void _fwRPC_worker_processQueue () synchronized(_g_fwRPC_worker_this)
 
private void _fwRPC_worker_sendState ()
 
private void _fwRPC_worker_register_active_request (dyn_mixed request)
 
private void _fwRPC_worker_unregister_active_request (dyn_mixed request)
 
private bool _fwRPC_worker_is_request_active (dyn_mixed request)
 

Variables

private global dyn_mixed _g_fwRPC_worker_this
 
private global dyn_dyn_mixed _g_fwRPC_worker_requestQueue
 
private global mapping _g_fwRPC_worker_activeRequests
 
private global bool _g_fwRPC_worker_isRunning = false
 
private global mapping _g_fwRPC_worker_funcDefs
 
private global anytype _g_fwRPC_worker_clientCtx
 

Detailed Description

This library contains the RPC worker functionality. The worker receives and executes functions. The worker requeires a running instance of the worker manager to be assigned requests. Part of the server-side RPC library.

The worker does not synchronize with the live data from its DP. Therefore, minimal writes should be made to the DP from outside this lib. Note that the Core lib modifies the STATUS field of the worker, but it has no actual affect on the worker's performance.

Should be run in it's own CTRL manager.

Author
Victor Rodrigues (CERN, BE-ICS-SDS)

Function Documentation

int fwRPC_worker_initialize ( int &  workerId)

Initialize and runs the worker. Creates a DP for this worker. Listens for requests from core.

Parameters
workerId(OUT, int) worker ID
Returns
0 on success -1 otherwise
Exceptions
nothing
bool fwRPC_worker_isRunning ( )

Return whether or not the worker is currently running/

Returns
true if running false otherwise
Exceptions
nothing
int fwRPC_worker_stop ( )

Stop the worker if currently running. Will halt all active requests and reset their state to READY, indicating that it is once again ready to be executed.

Returns
0 on success -1 otherwise
Exceptions
nothing

Variable Documentation

private global mapping _g_fwRPC_worker_activeRequests

Mapping of currently active requests. Structure: key = request hdl value = request object (see fwRPC_requestModel.ctl)

private global mapping _g_fwRPC_worker_funcDefs

Local function definition cache key: function name value: function object

private global bool _g_fwRPC_worker_isRunning = false

Whether or not the worker is currently running

private global dyn_dyn_mixed _g_fwRPC_worker_requestQueue

Local request queue. Requests which could not be immediately fulfilled are enqueued here.

Structure: DYN_DYN_STRING: [x]: request object (see fwRPC_requestModel.ctl)

private global dyn_mixed _g_fwRPC_worker_this

The local worker state. See fwRPC_workerModel.ctl