[sprog-users] Re: DBI Gear
Status: Alpha
Brought to you by:
grantm
From: Matthew K. <df...@ya...> - 2005-06-30 09:45:54
|
>Obviously Sprog needs the ability to source data from a database via > DBI. I'm trying to write one at the moment. >The tricky part of writing data source gears is the need for > non-blocking IO. If someone submits a query that takes several minutes > to complete, then we obviously want the "Stop" button to be functional > during that time. > Does anyone know if there are any hooks in DBI for using it > asynchronously? I'm not aware of anything built into DBI directly, but if the application needs to remain responsive while the query's executing then I would think that threads would be the best way to go. This is a bit more elegant than using fork(), particularly on platforms where Perl's support for fork is a bit of a kludge (I know it doesn't currently run on Windows, but I guess there shouldn't be anything that precludes it). The only drawback is that it makes this gear dependent on having Perl 5.8 installed. Anyway, I've got it about 50% written, when I'm close to finished I wouldn't mind getting some feedback or suggestions about it. One unrelated question: I haven't yet figured out how you're meant to modify a machine once you've constructed it (ie add or remove gears). The gears seem to connect OK when you drag them from the list on the left, but I haven't yet found a way of reconnecting gears which become disconnected in the machine (due to deleting gears), or to connect new gears in the middle of an existing machine. Is there something I'm missing ? ____________________________________________________ Do you Yahoo!? Try Yahoo! Photomail Beta: Send up to 300 photos in one email! http://au.photomail.mail.yahoo.com |