[pybsddb] bdb replica node problem
Yingbo Qiu
qiuyingbo at gmail.com
Thu May 29 03:26:13 CEST 2008
BTW: I think pybsddb's DBEnv object should supply a method to assign
some private item value.
I have to use global variable to pass it into event_callback function.
for example: db-4.7.25/examples_c/ex_rep/mgr/rep_mgr.c
static void
event_callback(dbenv, which, info)
DB_ENV *dbenv;
u_int32_t which;
void *info;
{
APP_DATA *app = dbenv->app_private;
SHARED_DATA *shared = &app->shared_data;
info = NULL; /* Currently unused. */
switch (which) {
case DB_EVENT_REP_CLIENT:
shared->is_master = 0;
break;
case DB_EVENT_REP_MASTER:
shared->is_master = 1;
break;
....
With pybsddb, programmer just set "shared" to a global variable. :(
More information about the pybsddb
mailing list