|
|
sybperl-l Archive
Up Prev Next
From: Andrew dot Crossland at citicorp dot com
Subject: Sybase::CTlib ct_callback
Date: Mar 22 2000 11:30AM
I have been hunting everywhere but cannot find the answer that I'm after. The
Sybperl documentation states that the interface to the ct_callback subroutine
is as follows:-
old_cb = ct_callback($type, $cb_func)
Install a callback routine. Valid callback types are CS_CLIENTMSG_CB and
CS_SERVERMSG_CB. Returns a reference to the previously installed callback of
the specified type, or undef if no callback of that type exists. Passing undef
as $cb_func unsets the callback for that type.
This would appear to setup callbacks applying to all database connections.
Looking at the OpenClient documentation, the ct_callback function accepts a
database connection as one of the parameters, thus enabling callbacks to be
defined as local to the database connection rather than applying to all
database connections.
I really want to enable the creation of multiple database connections with
potentially different callback handlers on the database connections. The ways
that I see this as possible are:-
* ct_callback is implemented as a method on an instance of Sybase::CTlib. This
may already be true but I can't find any documentation.
* The class method ct_callback accepts a new parameter which is an instance of
Sybase::CTlib. Not as nice as the other option but possible I guess.
If anyone has any further ideas then I would be grateful to read them.
Can anyone help? Thanks v.much,
Andrew.
|