|
|
sybperl-l Archive
Up Prev Next
From: Tom Poindexter <poindexter dot tom at tci dot com>
Subject: Re: Beginner question - doing async communications with Sybase
Date: Dec 5 1997 11:04PM
Hi Michael & gang,
On Fri, Dec 05, 1997 at 03:39:59PM -0700, a colleague of mine wrote:
>
> Are your ears burning? They are talking about sybtcl on the sybperl list.
>
> >Ashu Joglekar wrote:
> >>
> >> Hope I don't get flamed for this :-)
> >
> >I hope you've got your asbestos suit on :-) :-)
> >
> >> but sybtcl does support asynchronous queries.
> >> I haven't used them in a while but the implementation was quite robust.
Thanks Ashu!
> >
> >Does Tom use dbpoll() and friends?
> >
> >I've never written anything using that.
> >
> >Maybe I should look into the CTlib asynch model. It looked quite nice,
> >although I can't say I really looked into it seriously...
Sybtcl - It slices, It dices, It does async !!
Yes, the code uses dbsqlsend() to initiate an asynchronous request,
then uses dbpoll() to check on any or all of the open connections.
e.g.
set hand1 [sybconnect id pass SERVER]
set hand2 [sybconnect id pass SERVER]
sybsql $hand1 "select foo from bar" -async
sybsql $hand2 "select bar from foo" -async
set ready_hand [sybpoll $hand -1 -all]
sybnext $ready_hand {puts @0}
My DB-Lib to CT-Lib layer also supports this by emulating dbpoll() with
the appropriate CT-Lib functions.
--
Tom Poindexter
|