[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Long running DBI queries (gtk2 , threads)
- From: "A. Pagaltzis" <pagaltzis gmx de>
- To: GTK2-Perl List <gtk-perl-list gnome org>
- Subject: Re: Long running DBI queries (gtk2 , threads)
- Date: Fri, 2 Sep 2005 02:39:25 +0200
* 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.
Regards,
--
Aristotle
“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]