The Sequence Toolkit
www.sequence-toolkit.com
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
stk_smartbeat_api.h File Reference
#include "stk_smartbeat.h"
#include "stk_service.h"
#include "stk_name_service.h"
#include "stk_env.h"
Include dependency graph for stk_smartbeat_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

stk_smartbeat_ctrl_tstk_create_smartbeat_ctrl (stk_env_t *env)
 
stk_ret stk_destroy_smartbeat_ctrl (stk_smartbeat_ctrl_t *smb)
 
stk_ret stk_smartbeat_update_current_time (stk_smartbeat_t *smb)
 
int stk_min_smartbeat_interval (stk_smartbeat_ctrl_t *smb)
 
stk_ret stk_smartbeat_add_service (stk_smartbeat_ctrl_t *smb, stk_service_t *svc)
 
stk_ret stk_smartbeat_remove_service (stk_smartbeat_ctrl_t *smb, stk_service_t *svc)
 
stk_ret stk_smartbeat_add_name_service (stk_smartbeat_ctrl_t *smb, stk_name_service_t *svc)
 
stk_ret stk_smartbeat_remove_name_service (stk_smartbeat_ctrl_t *smb, stk_name_service_t *svc)
 
stk_bool stk_has_smartbeat_timed_out (stk_smartbeat_t *sb, stk_smartbeat_t *curr_time, stk_uint32 ivl)
 

Detailed Description

The stk_smartbeat module provides APIs that implement and control the aggregation of heartbeats (smartbeats), and their communication to other STK components

Function Documentation

stk_smartbeat_ctrl_t* stk_create_smartbeat_ctrl ( stk_env_t env)

Create a Smartbeat controller. The Smartbeat controller is responsible for sending smart beats to other components.

Parameters
envEnvironment this controller should use
Returns
The controller that was created or NULL
stk_ret stk_destroy_smartbeat_ctrl ( stk_smartbeat_ctrl_t smb)

Destroy a Smartbeat controller.

Parameters
smbSmartbeat controller to be destroyed
Returns
Whether the smartbeat was successfully destroyed
stk_bool stk_has_smartbeat_timed_out ( stk_smartbeat_t sb,
stk_smartbeat_t curr_time,
stk_uint32  ivl 
)

Determine if a smartbeat has past an interval

Parameters
sbThe smartbeat being tested
curr_timeThe current time (in smartbeat form)
ivlThe interval to be checked
Returns
STK_SUCCESS if the interval has expired
int stk_min_smartbeat_interval ( stk_smartbeat_ctrl_t smb)

Get the minimum time a smartbeat may occur.

Returns
The number of milliseconds allowed for a smartbeat
stk_ret stk_smartbeat_add_name_service ( stk_smartbeat_ctrl_t smb,
stk_name_service_t svc 
)

Add a name service to smartbeat controller for heartbeating

Parameters
smbSmartbeat controller to be added to
svcService to be added to the smartbeat controller
Returns
Whether the service was successfully added
stk_ret stk_smartbeat_add_service ( stk_smartbeat_ctrl_t smb,
stk_service_t svc 
)

Add service to smartbeat controller for heartbeating

Parameters
smbSmartbeat controller to be added to
svcService to be added to the smartbeat controller
Returns
Whether the service was successfully added
stk_ret stk_smartbeat_remove_name_service ( stk_smartbeat_ctrl_t smb,
stk_name_service_t svc 
)

Remove a name service from a smartbeat controller

Parameters
smbSmartbeat controller to be updated
svcService to be removed from the smartbeat controller
Returns
Whether the service was successfully removed
stk_ret stk_smartbeat_remove_service ( stk_smartbeat_ctrl_t smb,
stk_service_t svc 
)

Remove service from a smartbeat controller

Parameters
smbSmartbeat controller to be updated
svcService to be removed from the smartbeat controller
Returns
Whether the service was successfully removed
stk_ret stk_smartbeat_update_current_time ( stk_smartbeat_t smb)

Update the smartbeat with the current time

Parameters
smbSmartbeat controller to be updated
Returns
Whether the time update was successful