The Sequence Toolkit
www.sequence-toolkit.com |
#include "stk_name_service.h"
#include "stk_env.h"
#include "stk_data_flow.h"
#include "stk_common.h"
#include "stk_sequence.h"
Go to the source code of this file.
Functions | |
stk_ret | stk_request_name_info (stk_name_service_t *named, char *name, int expiration_ms, stk_name_info_cb_t cb, void *app_info, stk_options_t *options) |
stk_ret | stk_subscribe_to_name_info (stk_name_service_t *named, char *name, stk_name_info_cb_t cb, void *app_info, stk_options_t *options) |
stk_ret | stk_request_name_info_once (stk_name_service_t *named, char *name, int expiration_ms, stk_name_info_cb_t cb, void *app_info, stk_options_t *options) |
stk_ret | stk_register_name (stk_name_service_t *named, char *name, int linger, int expiration_ms, stk_name_info_cb_t cb, void *app_info, stk_options_t *options) |
stk_name_service_t * | stk_create_name_service (stk_env_t *env, stk_options_t *options) |
stk_ret | stk_destroy_name_service (stk_name_service_t *) |
stk_ret | stk_name_service_invoke (stk_sequence_t *seq) |
stk_data_flow_t ** | stk_ns_get_smartbeat_flows (stk_name_service_t *svc) |
The Name service is a generic service to register and query names. Each environment connects to a name server by default, but applications may create their own. Name service creation will initiate a connection to the name server.
stk_name_service_t* stk_create_name_service | ( | stk_env_t * | env, |
stk_options_t * | options | ||
) |
API to create a name service
env | The STK environment to be used |
options | Options used to configure this name service connection |
stk_ret stk_destroy_name_service | ( | stk_name_service_t * | ) |
API to destroy a name service
stk_ret stk_name_service_invoke | ( | stk_sequence_t * | seq | ) |
API to invoke name services on a received sequence
stk_data_flow_t** stk_ns_get_smartbeat_flows | ( | stk_name_service_t * | svc | ) |
Get array of flows that need to be sent to for heartbeats. Array ends with NULL Caller must free returned data with free()
stk_ret stk_register_name | ( | stk_name_service_t * | named, |
char * | name, | ||
int | linger, | ||
int | expiration_ms, | ||
stk_name_info_cb_t | cb, | ||
void * | app_info, | ||
stk_options_t * | options | ||
) |
API to register a name with the name service
env | The STK environment to be used |
name | The name to be registered |
linger | The number of seconds this name should live after being disconnected |
expiration_sz | The number of milliseconds this request should live for (Must be >0) |
cb | The callback to be executed when the registration response is received |
options | Options used to configure this name at the name server |
stk_ret stk_request_name_info | ( | stk_name_service_t * | named, |
char * | name, | ||
int | expiration_ms, | ||
stk_name_info_cb_t | cb, | ||
void * | app_info, | ||
stk_options_t * | options | ||
) |
API to retrieve information about a name from the name service This API may cause repeated callbacks
named | The STK Name Service to be used |
name | The name to be queried for |
expiration_sz | The number of milliseconds this request should live for (Must be >0) |
cb | The callback to be executed when info is received |
app_info | Application data pointer for this request (passed to cb) |
options | Options used to configure the server and the information requested |
stk_ret stk_request_name_info_once | ( | stk_name_service_t * | named, |
char * | name, | ||
int | expiration_ms, | ||
stk_name_info_cb_t | cb, | ||
void * | app_info, | ||
stk_options_t * | options | ||
) |
API to retreive information about a name from the name service This API will cause at most 1 callback
stk_ret stk_subscribe_to_name_info | ( | stk_name_service_t * | named, |
char * | name, | ||
stk_name_info_cb_t | cb, | ||
void * | app_info, | ||
stk_options_t * | options | ||
) |
API to subscribe to name updates from the name service. Subscriptions expire after 24 hours. Subscriptions will be reestablished as soon as possible after a name server restart, but this may be up to one minute depending on the network transport used. This API is designed to cause repeated callbacks.
named | The STK Name Service to be used |
name | The name to be queried for |
cb | The callback to be executed when info is received |
app_info | Application data pointer for this request (passed to cb) |
options | Options used to configure the server and the information requested |