Re: Long running DBI queries (gtk2 , threads)

* ofey aikon <ofey aikon gmail com> [2005-09-01 22:25]:
You get to refer to this thing by a name so that you can call
it later.

$mythread->register_sql('<some name>', \&call_sql, \&call_back);

Later on, this registered sql can be triggered by calling
$mythread->execute('<some name>',[<list of parameters>]);

This seems like bad API design. Instead of requiring the
programmer to make up a name to refer to the information, return
an object from the register call that encapsulates all the
necessary information.

    my $threaded_query = $mythread->register_sql( \&call_sql, \&call_back );

    $threaded_query->execute( @some_params );

Thatâs the first thing that comes to mind; I havenât looked at
the code yet.

âLike punning, programming is a play on words.â
   â Alan J. Perlis, âEpigrams in Programmingâ

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]