dnxDispatcher.h File Reference

Definitions and prototypes for the DNX Dispatcher thread. More...

#include "dnxJobList.h"
#include "dnxTransport.h"

Go to the source code of this file.

Data Structures

struct  DnxDispatcher
 Abstract data type for the DNX job dispatcher. More...

Functions

DnxChanneldnxDispatcherGetChannel (DnxDispatcher *disp)
 Return a reference to the dispatcher channel object.
int dnxDispatcherCreate (char *chname, char *url, DnxJobList *joblist, DnxDispatcher **pdisp)
 Create a new dispatcher object.
void dnxDispatcherDestroy (DnxDispatcher *disp)
 Destroy an existing dispatcher object.


Detailed Description

Definitions and prototypes for the DNX Dispatcher thread.

The purpose of this thread is to dispatch service check jobs to the registered worker nodes for execution. It accomplishes this by accepting work node registrations and then dispatching service check jobs to registered worker nodes using a weighted-round-robin algorithm. The algorithm's weighting is based upon the number of jobs-per-second throughput rating of each worker node.

Author:
Robert W. Ingraham (dnx-devel@lists.sourceforge.net)
Attention:
Please submit patches to http://dnx.sourceforge.net

Definition in file dnxDispatcher.h.


Function Documentation

int dnxDispatcherCreate ( char *  chname,
char *  url,
DnxJobList joblist,
DnxDispatcher **  pdisp 
)

Create a new dispatcher object.

Parameters:
[in] chname - the name of the dispatch channel.
[in] url - the dispatcher channel URL.
[in] joblist - a pointer to the global job list object.
[out] pdisp - the address of storage for the return of the new dispatcher object.
Returns:
Zero on success, or a non-zero error value.
Parameters:
[in] chname - the name of the dispatch channel.
[in] url - the dispatcher channel url.
[in] joblist - a pointer to the global job list object.
[out] pdisp - the address of storage for the return of the new dispatcher object.
Returns:
Zero on success, or a non-zero error value.

Definition at line 177 of file dnxDispatcher.c.

References iDnxDispatcher_::channel, iDnxDispatcher_::chname, DNX_ERR_MEMORY, DNX_ERR_THREAD, DNX_MODE_PASSIVE, DNX_OK, dnxChanMapAdd(), dnxChanMapDelete(), dnxConnect(), dnxDisconnect(), dnxDispatcher(), dnxErrorString(), dnxLog(), iDnxDispatcher_::joblist, iDnxDispatcher_::tid, iDnxDispatcher_::url, xfree, xmalloc, and xstrdup.

Referenced by dnxServerInit().

void dnxDispatcherDestroy ( DnxDispatcher disp  ) 

Destroy an existing dispatcher object.

Parameters:
[in] disp - a pointer to the dispatcher object to be destroyed.

Definition at line 239 of file dnxDispatcher.c.

References iDnxDispatcher_::channel, iDnxDispatcher_::chname, dnxChanMapDelete(), dnxDisconnect(), iDnxDispatcher_::tid, iDnxDispatcher_::url, and xfree.

Referenced by dnxServerDeInit().

DnxChannel* dnxDispatcherGetChannel ( DnxDispatcher disp  ) 

Return a reference to the dispatcher channel object.

Parameters:
[in] disp - the dispatcher whose dispatch channel should be returned.
Returns:
A pointer to the dispatcher channel object.
Return a reference to the dispatcher channel object.

This method exists so the registrar can send a job on the same socket from which it received a job request.

Parameters:
[in] disp - the dispatcher from which to retrieve the channel.
Returns:
the DnxChannel object belonging to disp.

Definition at line 172 of file dnxDispatcher.c.

Referenced by dnxServerInit().


Generated on Tue Apr 13 15:48:08 2010 for DNX by  doxygen 1.5.6